using System;
using System.Data;
using System.Data.OleDb;
using System.Runtime.InteropServices;
using PCSComUtils.Common;
using PCSComUtils.DataAccess;

using PCSComUtils.PCSExc;

namespace PCSComProduct.Costing.DS
{
	[Guid("6CD75909-D4C5-40ac-95BB-BA9F14F613C6")]
	public class ITM_CostDS ////: IObjectDS
	{
		public ITM_CostDS()
		{
		}

		private const string THIS = "PCSComProduct.Costing.DS.ITM_CostDS";


		//**************************************************************************              
		///    <Description>
		///       This method uses to add data to ITM_Cost
		///    </Description>
		///    <Inputs>
		///        ITM_CostVO       
		///    </Inputs>
		///    <Outputs>
		///       newly inserted primarkey value
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       HungLa
		///       DungLa : 17-Mar-2005
		///    </Authors>
		///    <History>
		///       Wednesday, March 16, 2005
		///       17-Mar-2005: check for null CCNID - DungLa
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public void Add(object pobjObjectVO)
		{
			const string METHOD_NAME = THIS + ".Add()";

			OleDbConnection oconPCS = null;
			OleDbCommand ocmdPCS = null;
			try
			{
				ITM_CostVO objObject = (ITM_CostVO) pobjObjectVO;
				string strSql = String.Empty;
				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand("", oconPCS);

				strSql = "INSERT INTO ITM_Cost("
					+ ITM_CostTable.SINGLEROLLUPDATE_FLD + ","
					+ ITM_CostTable.MULTIROLLUPDATE_FLD + ","
					+ ITM_CostTable.COSTSETUPDATE_FLD + ","
					+ ITM_CostTable.COMMATERIAL01_FLD + ","
					+ ITM_CostTable.COMMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostTable.COMMACHINESETUP03_FLD + ","
					+ ITM_CostTable.COMMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostTable.COMMACHINESETUPVAR05_FLD + ","
					+ ITM_CostTable.COMMACHINERUN06_FLD + ","
					+ ITM_CostTable.COMMACHINEFIXED07_FLD + ","
					+ ITM_CostTable.COMMACHINEVARIABLE08_FLD + ","
					+ ITM_CostTable.COMLABORSETUP09_FLD + ","
					+ ITM_CostTable.COMLABORSETUPFIXED10_FLD + ","
					+ ITM_CostTable.COMLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostTable.COMLABORRUN12_FLD + ","
					+ ITM_CostTable.COMLABORFIXED13_FLD + ","
					+ ITM_CostTable.COMLABORVARIABLE14_FLD + ","
					+ ITM_CostTable.COMOUTSIDEPROC15_FLD + ","
					+ ITM_CostTable.COMASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostTable.COMSHRINK17_FLD + ","
					+ ITM_CostTable.COMFREIGHT18_FLD + ","
					+ ITM_CostTable.COMUSERSTANDARD1_19_FLD + ","
					+ ITM_CostTable.COMUSERSTANDARD2_20_FLD + ","
					+ ITM_CostTable.COMTOTALAMOUNT21_FLD + ","
					+ ITM_CostTable.VADDCOSTMATERIAL01_FLD + ","
					+ ITM_CostTable.VADDCOSTMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINESETUP03_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINESETUPVAR05_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINERUN06_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINEFIXED07_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINEVARIABLE08_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORSETUP09_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORSETUPFIXED10_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORRUN12_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORFIXED13_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORVARIABLE14_FLD + ","
					+ ITM_CostTable.VADDCOSTOUTSIDEPROC15_FLD + ","
					+ ITM_CostTable.VADDCOSTASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostTable.VADDCOSTSHRINK17_FLD + ","
					+ ITM_CostTable.VADDCOSTFREIGHT18_FLD + ","
					+ ITM_CostTable.VADDCOSTUSERSTANDARD1_19_FLD + ","
					+ ITM_CostTable.VADDCOSTUSERSTANDARD2_20_FLD + ","
					+ ITM_CostTable.VADDCOSTTOTALAMOUNT21_FLD + ","
					+ ITM_CostTable.COMPONENTLABORRUNHOUR_FLD + ","
					+ ITM_CostTable.COMPONENTLABORSETUPHOUR_FLD + ","
					+ ITM_CostTable.COMPONENTMACHINERUNHOUR_FLD + ","
					+ ITM_CostTable.COMPONENTMACHINESETUPHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDLABORRUNHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDLABORSETUPHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDMACHINERUNHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDMACHINESETUPHOUR_FLD + ","
					+ ITM_CostTable.ITEMLABORRUNHOUR_FLD + ","
					+ ITM_CostTable.ITEMLABORSETUPHOUR_FLD + ","
					+ ITM_CostTable.ITEMMACHINERUNHOUR_FLD + ","
					+ ITM_CostTable.ITEMMACHINESETUPHOUR_FLD + ","
					+ ITM_CostTable.BCR_FLD + ","
					+ ITM_CostTable.ITEMCOSTMATERIAL01_FLD + ","
					+ ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINERUN06_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUP09_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORRUN12_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORFIXED13_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD + ","
					+ ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD + ","
					+ ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostTable.ITEMCOSTSHRINK17_FLD + ","
					+ ITM_CostTable.ITEMCOSTFREIGHT18_FLD + ","
					+ ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD + ","
					+ ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD + ","
					+ ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD + ","
					+ ITM_CostTable.PRODUCTID_FLD + ","
					+ ITM_CostTable.CCNID_FLD + ","
					+ ITM_CostTable.COSTDESCRIPTION_FLD + ")"
					+ "VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.SINGLEROLLUPDATE_FLD, OleDbType.Date));
				ocmdPCS.Parameters[ITM_CostTable.SINGLEROLLUPDATE_FLD].Value = objObject.SingleRollUpDate;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.MULTIROLLUPDATE_FLD, OleDbType.Date));
				ocmdPCS.Parameters[ITM_CostTable.MULTIROLLUPDATE_FLD].Value = objObject.MultiRollUpDate;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COSTSETUPDATE_FLD, OleDbType.Date));
				ocmdPCS.Parameters[ITM_CostTable.COSTSETUPDATE_FLD].Value = objObject.CostSetupDate;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMMATERIAL01_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMMATERIAL01_FLD].Value = objObject.ComMaterial01;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMMATERIALOVERHEAD02_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMMATERIALOVERHEAD02_FLD].Value = objObject.ComMaterialOverHead02;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMMACHINESETUP03_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMMACHINESETUP03_FLD].Value = objObject.ComMachineSetup03;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMMACHINESETUPFIXED04_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMMACHINESETUPFIXED04_FLD].Value = objObject.ComMachineSetupFixed04;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMMACHINESETUPVAR05_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMMACHINESETUPVAR05_FLD].Value = objObject.ComMachineSetupVar05;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMMACHINERUN06_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMMACHINERUN06_FLD].Value = objObject.ComMachineRun06;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMMACHINEFIXED07_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMMACHINEFIXED07_FLD].Value = objObject.ComMachineFixed07;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMMACHINEVARIABLE08_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMMACHINEVARIABLE08_FLD].Value = objObject.ComMachineVariable08;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMLABORSETUP09_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMLABORSETUP09_FLD].Value = objObject.ComLaborSetup09;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMLABORSETUPFIXED10_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMLABORSETUPFIXED10_FLD].Value = objObject.ComLaborSetupFixed10;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMLABORSETUPVARIABLE11_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMLABORSETUPVARIABLE11_FLD].Value = objObject.ComLaborSetupVariable11;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMLABORRUN12_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMLABORRUN12_FLD].Value = objObject.ComLaborRun12;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMLABORFIXED13_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMLABORFIXED13_FLD].Value = objObject.ComLaborFixed13;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMLABORVARIABLE14_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMLABORVARIABLE14_FLD].Value = objObject.ComLaborVariable14;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMOUTSIDEPROC15_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMOUTSIDEPROC15_FLD].Value = objObject.ComOutsideProc15;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMASSEMBLYSCRAP16_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMASSEMBLYSCRAP16_FLD].Value = objObject.ComAssemblyScrap16;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMSHRINK17_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMSHRINK17_FLD].Value = objObject.ComShrink17;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMFREIGHT18_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMFREIGHT18_FLD].Value = objObject.ComFreight18;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMUSERSTANDARD1_19_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMUSERSTANDARD1_19_FLD].Value = objObject.ComUserStandard1_19;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMUSERSTANDARD2_20_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMUSERSTANDARD2_20_FLD].Value = objObject.ComUserStandard2_20;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMTOTALAMOUNT21_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMTOTALAMOUNT21_FLD].Value = objObject.ComTotalAmount21;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTMATERIAL01_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTMATERIAL01_FLD].Value = objObject.VAddCostMaterial01;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTMATERIALOVERHEAD02_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTMATERIALOVERHEAD02_FLD].Value = objObject.VAddCostMaterialOverHead02;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTMACHINESETUP03_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTMACHINESETUP03_FLD].Value = objObject.VAddCostMachineSetup03;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTMACHINESETUPFIXED04_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTMACHINESETUPFIXED04_FLD].Value = objObject.VAddCostMachineSetupFixed04;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTMACHINESETUPVAR05_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTMACHINESETUPVAR05_FLD].Value = objObject.VAddCostMachineSetupVar05;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTMACHINERUN06_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTMACHINERUN06_FLD].Value = objObject.VAddCostMachineRun06;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTMACHINEFIXED07_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTMACHINEFIXED07_FLD].Value = objObject.VAddCostMachineFixed07;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTMACHINEVARIABLE08_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTMACHINEVARIABLE08_FLD].Value = objObject.VAddCostMachineVariable08;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTLABORSETUP09_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTLABORSETUP09_FLD].Value = objObject.VAddCostLaborSetup09;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTLABORSETUPFIXED10_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTLABORSETUPFIXED10_FLD].Value = objObject.VAddCostLaborSetupFixed10;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTLABORSETUPVARIABLE11_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTLABORSETUPVARIABLE11_FLD].Value = objObject.VAddCostLaborSetupVariable11;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTLABORRUN12_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTLABORRUN12_FLD].Value = objObject.VAddCostLaborRun12;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTLABORFIXED13_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTLABORFIXED13_FLD].Value = objObject.VAddCostLaborFixed13;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTLABORVARIABLE14_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTLABORVARIABLE14_FLD].Value = objObject.VAddCostLaborVariable14;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTOUTSIDEPROC15_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTOUTSIDEPROC15_FLD].Value = objObject.VAddCostOutsideProc15;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTASSEMBLYSCRAP16_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTASSEMBLYSCRAP16_FLD].Value = objObject.VAddCostAssemblyScrap16;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTSHRINK17_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTSHRINK17_FLD].Value = objObject.VAddCostShrink17;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTFREIGHT18_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTFREIGHT18_FLD].Value = objObject.VAddCostFreight18;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTUSERSTANDARD1_19_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTUSERSTANDARD1_19_FLD].Value = objObject.VAddCostUserStandard1_19;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTUSERSTANDARD2_20_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTUSERSTANDARD2_20_FLD].Value = objObject.VAddCostUserStandard2_20;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTTOTALAMOUNT21_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTTOTALAMOUNT21_FLD].Value = objObject.VAddCostTotalAmount21;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMPONENTLABORRUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMPONENTLABORRUNHOUR_FLD].Value = objObject.ComponentLaborRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMPONENTLABORSETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMPONENTLABORSETUPHOUR_FLD].Value = objObject.ComponentLaborSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMPONENTMACHINERUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMPONENTMACHINERUNHOUR_FLD].Value = objObject.ComponentMachineRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMPONENTMACHINESETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMPONENTMACHINESETUPHOUR_FLD].Value = objObject.ComponentMachineSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VALUEADDEDLABORRUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VALUEADDEDLABORRUNHOUR_FLD].Value = objObject.ValueAddedLaborRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VALUEADDEDLABORSETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VALUEADDEDLABORSETUPHOUR_FLD].Value = objObject.ValueAddedLaborSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VALUEADDEDMACHINERUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VALUEADDEDMACHINERUNHOUR_FLD].Value = objObject.ValueAddedMachineRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VALUEADDEDMACHINESETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VALUEADDEDMACHINESETUPHOUR_FLD].Value = objObject.ValueAddedMachineSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMLABORRUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMLABORRUNHOUR_FLD].Value = objObject.ItemLaborRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMLABORSETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMLABORSETUPHOUR_FLD].Value = objObject.ItemLaborSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMMACHINERUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMMACHINERUNHOUR_FLD].Value = objObject.ItemMachineRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMMACHINESETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMMACHINESETUPHOUR_FLD].Value = objObject.ItemMachineSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.BCR_FLD, OleDbType.VarChar));
				ocmdPCS.Parameters[ITM_CostTable.BCR_FLD].Value = objObject.BCR;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMATERIAL01_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMATERIAL01_FLD].Value = objObject.ItemCostMaterial01;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD].Value = objObject.ItemCostMaterialOverHead02;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD].Value = objObject.ItemCostMachineSetup03;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD].Value = objObject.ItemCostMachineSetupFixed04;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD].Value = objObject.ItemCostMachineSetupVar05;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINERUN06_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINERUN06_FLD].Value = objObject.ItemCostMachineRun06;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD].Value = objObject.ItemCostMachineFixed07;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD].Value = objObject.ItemCostMachineVariable08;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORSETUP09_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORSETUP09_FLD].Value = objObject.ItemCostLaborSetup09;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD].Value = objObject.ItemCostLaborSetupFixed10;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD].Value = objObject.ItemCostLaborSetupVariable11;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORRUN12_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORRUN12_FLD].Value = objObject.ItemCostLaborRun12;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORFIXED13_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORFIXED13_FLD].Value = objObject.ItemCostLaborFixed13;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD].Value = objObject.ItemCostLaborVariable14;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD].Value = objObject.ItemCostOutsideProc15;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD].Value = objObject.ItemCostAssemblyScrap16;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTSHRINK17_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTSHRINK17_FLD].Value = objObject.ItemCostShrink17;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTFREIGHT18_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTFREIGHT18_FLD].Value = objObject.ItemCostFreight18;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD].Value = objObject.ItemCostUserStandard1_19;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD].Value = objObject.ItemCostUserStandard2_20;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD].Value = objObject.ItemCostTotalAmount21;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.PRODUCTID_FLD, OleDbType.Integer));
				ocmdPCS.Parameters[ITM_CostTable.PRODUCTID_FLD].Value = objObject.ProductID;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.CCNID_FLD, OleDbType.Integer));
				// edited by Dungla: 17-Mar-2005
				if (objObject.CCNID > 0)
					ocmdPCS.Parameters[ITM_CostTable.CCNID_FLD].Value = objObject.CCNID;
				else
					ocmdPCS.Parameters[ITM_CostTable.CCNID_FLD].Value = DBNull.Value;
				//---

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COSTDESCRIPTION_FLD, OleDbType.VarWChar));
				ocmdPCS.Parameters[ITM_CostTable.COSTDESCRIPTION_FLD].Value = objObject.CostDescription;


				ocmdPCS.CommandText = strSql;
				ocmdPCS.Connection.Open();
				ocmdPCS.ExecuteNonQuery();

			}
			catch (OleDbException ex)
			{
				if (ex.Errors.Count > 1)
				{
					if (ex.Errors[1].NativeError == ErrorCode.SQLDUPLICATE_KEYCODE)
					{
						throw new PCSDBException(ErrorCode.DUPLICATE_KEY, METHOD_NAME, ex);
					}
					else
					{
						throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
					}
				}
				else
					throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
			}

			catch (InvalidOperationException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
			}
			catch (Exception ex)
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally
			{
				if (oconPCS != null)
				{
					if (oconPCS.State != ConnectionState.Closed)
					{
						oconPCS.Close();
					}
				}
			}
		}


		//**************************************************************************              
		///    <Description>
		///       This method uses to add data to ITM_Cost
		///    </Description>
		///    <Inputs>
		///        ITM_CostVO       
		///    </Inputs>
		///    <Outputs>
		///       newly inserted primarkey value
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       HungLa
		///       DungLa : 17-Mar-2005
		///    </Authors>
		///    <History>
		///       Wednesday, March 16, 2005
		///       17-Mar-2005: check for null CCNID - DungLa
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public void AddItemCostMaintenance(object pobjObjectVO)
		{
			const string METHOD_NAME = THIS + ".AddItemCostMaintenance()";

			OleDbConnection oconPCS = null;
			OleDbCommand ocmdPCS = null;
			try
			{
				ITM_CostVO objObject = (ITM_CostVO) pobjObjectVO;
				string strSql = String.Empty;
				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand("", oconPCS);

				strSql = "INSERT INTO ITM_Cost("
					+ ITM_CostTable.PRODUCTID_FLD + ","
					+ ITM_CostTable.MANUAL_FLD + ","
					+ ITM_CostTable.CCNID_FLD + ","
					+ ITM_CostTable.COSTDESCRIPTION_FLD + ")"
					+ "VALUES(?,?,?,?)";

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.PRODUCTID_FLD, OleDbType.Integer));
				ocmdPCS.Parameters[ITM_CostTable.PRODUCTID_FLD].Value = objObject.ProductID;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.MANUAL_FLD, OleDbType.Boolean));
				ocmdPCS.Parameters[ITM_CostTable.MANUAL_FLD].Value = objObject.Manual;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.CCNID_FLD, OleDbType.Integer));
				// edited by Dungla: 17-Mar-2005
				if (objObject.CCNID > 0)
					ocmdPCS.Parameters[ITM_CostTable.CCNID_FLD].Value = objObject.CCNID;
				else
					ocmdPCS.Parameters[ITM_CostTable.CCNID_FLD].Value = DBNull.Value;
				//---

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COSTDESCRIPTION_FLD, OleDbType.VarWChar));
				ocmdPCS.Parameters[ITM_CostTable.COSTDESCRIPTION_FLD].Value = objObject.CostDescription;


				ocmdPCS.CommandText = strSql;
				ocmdPCS.Connection.Open();
				ocmdPCS.ExecuteNonQuery();

			}
			catch (OleDbException ex)
			{
				if (ex.Errors.Count > 1)
				{
					if (ex.Errors[1].NativeError == ErrorCode.SQLDUPLICATE_KEYCODE)
					{
						throw new PCSDBException(ErrorCode.DUPLICATE_KEY, METHOD_NAME, ex);
					}
					else
					{
						throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
					}
				}
				else
					throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
			}

			catch (InvalidOperationException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
			}
			catch (Exception ex)
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally
			{
				if (oconPCS != null)
				{
					if (oconPCS.State != ConnectionState.Closed)
					{
						oconPCS.Close();
					}
				}
			}
		}


		//**************************************************************************              
		///    <Description>
		///       This method uses to delete data from ITM_Cost
		///    </Description>
		///    <Inputs>
		///        ID       
		///    </Inputs>
		///    <Outputs>
		///       void
		///    </Outputs>
		///    <Returns>
		///       
		///    </Returns>
		///    <Authors>
		///       HungLa
		///    </Authors>
		///    <History>
		///       09-Dec-2004
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public void Delete(int pintID)
		{
			const string METHOD_NAME = THIS + ".Delete()";
			string strSql = String.Empty;
			strSql = "DELETE " + ITM_CostTable.TABLE_NAME + " WHERE  " + "Manual" + "=" + pintID.ToString();
			OleDbConnection oconPCS = null;
			OleDbCommand ocmdPCS = null;
			try
			{
				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);

				ocmdPCS.Connection.Open();
				ocmdPCS.ExecuteNonQuery();
				ocmdPCS = null;

			}
			catch (OleDbException ex)
			{
				if (ex.Errors.Count > 1)
				{
					if (ex.Errors[1].NativeError == ErrorCode.SQLDUPLICATE_KEYCODE)
					{
						throw new PCSDBException(ErrorCode.DUPLICATE_KEY, METHOD_NAME, ex);
					}
					else
					{
						throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
					}
				}
				else
					throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
			}

			catch (Exception ex)
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}


			finally
			{
				if (oconPCS != null)
				{
					if (oconPCS.State != ConnectionState.Closed)
					{
						oconPCS.Close();
					}
				}
			}
		}


		//**************************************************************************              
		///    <Description>
		///       This method uses to get data from ITM_Cost
		///    </Description>
		///    <Inputs>
		///        ID       
		///    </Inputs>
		///    <Outputs>
		///       ITM_CostVO
		///    </Outputs>
		///    <Returns>
		///       ITM_CostVO
		///    </Returns>
		///    <Authors>
		///       HungLa
		///       DungLa: 24-Mar-2005
		///    </Authors>
		///    <History>
		///       Wednesday, March 16, 2005
		///       24-Mar-2005: DungLa: check for null value from DB
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public object GetObjectVO(int pintID)
		{
			const string METHOD_NAME = THIS + ".GetObjectVO()";
			DataSet dstPCS = new DataSet();

			OleDbDataReader odrPCS = null;
			OleDbConnection oconPCS = null;
			OleDbCommand ocmdPCS = null;
			try
			{
				string strSql = String.Empty;
				strSql = "SELECT "
					+ ITM_CostTable.MANUAL_FLD + ","
					+ ITM_CostTable.SINGLEROLLUPDATE_FLD + ","
					+ ITM_CostTable.MULTIROLLUPDATE_FLD + ","
					+ ITM_CostTable.COSTSETUPDATE_FLD + ","
					+ ITM_CostTable.COMMATERIAL01_FLD + ","
					+ ITM_CostTable.COMMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostTable.COMMACHINESETUP03_FLD + ","
					+ ITM_CostTable.COMMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostTable.COMMACHINESETUPVAR05_FLD + ","
					+ ITM_CostTable.COMMACHINERUN06_FLD + ","
					+ ITM_CostTable.COMMACHINEFIXED07_FLD + ","
					+ ITM_CostTable.COMMACHINEVARIABLE08_FLD + ","
					+ ITM_CostTable.COMLABORSETUP09_FLD + ","
					+ ITM_CostTable.COMLABORSETUPFIXED10_FLD + ","
					+ ITM_CostTable.COMLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostTable.COMLABORRUN12_FLD + ","
					+ ITM_CostTable.COMLABORFIXED13_FLD + ","
					+ ITM_CostTable.COMLABORVARIABLE14_FLD + ","
					+ ITM_CostTable.COMOUTSIDEPROC15_FLD + ","
					+ ITM_CostTable.COMASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostTable.COMSHRINK17_FLD + ","
					+ ITM_CostTable.COMFREIGHT18_FLD + ","
					+ ITM_CostTable.COMUSERSTANDARD1_19_FLD + ","
					+ ITM_CostTable.COMUSERSTANDARD2_20_FLD + ","
					+ ITM_CostTable.COMTOTALAMOUNT21_FLD + ","
					+ ITM_CostTable.VADDCOSTMATERIAL01_FLD + ","
					+ ITM_CostTable.VADDCOSTMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINESETUP03_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINESETUPVAR05_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINERUN06_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINEFIXED07_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINEVARIABLE08_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORSETUP09_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORSETUPFIXED10_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORRUN12_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORFIXED13_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORVARIABLE14_FLD + ","
					+ ITM_CostTable.VADDCOSTOUTSIDEPROC15_FLD + ","
					+ ITM_CostTable.VADDCOSTASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostTable.VADDCOSTSHRINK17_FLD + ","
					+ ITM_CostTable.VADDCOSTFREIGHT18_FLD + ","
					+ ITM_CostTable.VADDCOSTUSERSTANDARD1_19_FLD + ","
					+ ITM_CostTable.VADDCOSTUSERSTANDARD2_20_FLD + ","
					+ ITM_CostTable.VADDCOSTTOTALAMOUNT21_FLD + ","
					+ ITM_CostTable.COMPONENTLABORRUNHOUR_FLD + ","
					+ ITM_CostTable.COMPONENTLABORSETUPHOUR_FLD + ","
					+ ITM_CostTable.COMPONENTMACHINERUNHOUR_FLD + ","
					+ ITM_CostTable.COMPONENTMACHINESETUPHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDLABORRUNHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDLABORSETUPHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDMACHINERUNHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDMACHINESETUPHOUR_FLD + ","
					+ ITM_CostTable.ITEMLABORRUNHOUR_FLD + ","
					+ ITM_CostTable.ITEMLABORSETUPHOUR_FLD + ","
					+ ITM_CostTable.ITEMMACHINERUNHOUR_FLD + ","
					+ ITM_CostTable.ITEMMACHINESETUPHOUR_FLD + ","
					+ ITM_CostTable.BCR_FLD + ","
					+ ITM_CostTable.ITEMCOSTMATERIAL01_FLD + ","
					+ ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINERUN06_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUP09_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORRUN12_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORFIXED13_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD + ","
					+ ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD + ","
					+ ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostTable.ITEMCOSTSHRINK17_FLD + ","
					+ ITM_CostTable.ITEMCOSTFREIGHT18_FLD + ","
					+ ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD + ","
					+ ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD + ","
					+ ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD + ","
					+ ITM_CostTable.PRODUCTID_FLD + ","
					+ ITM_CostTable.COSTID_FLD + ","
					+ ITM_CostTable.CCNID_FLD + ","
					+ ITM_CostTable.COSTDESCRIPTION_FLD
					+ " FROM " + ITM_CostTable.TABLE_NAME
					+ " WHERE " + ITM_CostTable.MANUAL_FLD + "=" + pintID;

				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);

				ocmdPCS.Connection.Open();
				odrPCS = ocmdPCS.ExecuteReader();

				ITM_CostVO objObject = new ITM_CostVO();

				while (odrPCS.Read())
				{
					if (odrPCS[ITM_CostTable.MANUAL_FLD] != DBNull.Value)
						objObject.Manual = bool.Parse(odrPCS[ITM_CostTable.MANUAL_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.SINGLEROLLUPDATE_FLD] != DBNull.Value)
						objObject.SingleRollUpDate = DateTime.Parse(odrPCS[ITM_CostTable.SINGLEROLLUPDATE_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.MULTIROLLUPDATE_FLD] != DBNull.Value)
						objObject.MultiRollUpDate = DateTime.Parse(odrPCS[ITM_CostTable.MULTIROLLUPDATE_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COSTSETUPDATE_FLD] != DBNull.Value)
						objObject.CostSetupDate = DateTime.Parse(odrPCS[ITM_CostTable.COSTSETUPDATE_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMMATERIAL01_FLD]!= DBNull.Value)
						objObject.ComMaterial01 = Decimal.Parse(odrPCS[ITM_CostTable.COMMATERIAL01_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMMATERIALOVERHEAD02_FLD] != DBNull.Value)
						objObject.ComMaterialOverHead02 = Decimal.Parse(odrPCS[ITM_CostTable.COMMATERIALOVERHEAD02_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMMACHINESETUP03_FLD] != DBNull.Value)
						objObject.ComMachineSetup03 = Decimal.Parse(odrPCS[ITM_CostTable.COMMACHINESETUP03_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMMACHINESETUPFIXED04_FLD] != DBNull.Value)
						objObject.ComMachineSetupFixed04 = Decimal.Parse(odrPCS[ITM_CostTable.COMMACHINESETUPFIXED04_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMMACHINESETUPVAR05_FLD] != DBNull.Value)
						objObject.ComMachineSetupVar05 = Decimal.Parse(odrPCS[ITM_CostTable.COMMACHINESETUPVAR05_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMMACHINERUN06_FLD] != DBNull.Value)
						objObject.ComMachineRun06 = Decimal.Parse(odrPCS[ITM_CostTable.COMMACHINERUN06_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMMACHINEFIXED07_FLD] != DBNull.Value)
						objObject.ComMachineFixed07 = Decimal.Parse(odrPCS[ITM_CostTable.COMMACHINEFIXED07_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMMACHINEVARIABLE08_FLD] != DBNull.Value)
						objObject.ComMachineVariable08 = Decimal.Parse(odrPCS[ITM_CostTable.COMMACHINEVARIABLE08_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMLABORSETUP09_FLD] != DBNull.Value)
						objObject.ComLaborSetup09 = Decimal.Parse(odrPCS[ITM_CostTable.COMLABORSETUP09_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMLABORSETUPFIXED10_FLD] != DBNull.Value)
						objObject.ComLaborSetupFixed10 = Decimal.Parse(odrPCS[ITM_CostTable.COMLABORSETUPFIXED10_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMLABORSETUPVARIABLE11_FLD] != DBNull.Value)
						objObject.ComLaborSetupVariable11 = Decimal.Parse(odrPCS[ITM_CostTable.COMLABORSETUPVARIABLE11_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMLABORRUN12_FLD] != DBNull.Value)
						objObject.ComLaborRun12 = Decimal.Parse(odrPCS[ITM_CostTable.COMLABORRUN12_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMLABORFIXED13_FLD] != DBNull.Value)
						objObject.ComLaborFixed13 = Decimal.Parse(odrPCS[ITM_CostTable.COMLABORFIXED13_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMLABORVARIABLE14_FLD] != DBNull.Value)
						objObject.ComLaborVariable14 = Decimal.Parse(odrPCS[ITM_CostTable.COMLABORVARIABLE14_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMOUTSIDEPROC15_FLD] != DBNull.Value)
						objObject.ComOutsideProc15 = Decimal.Parse(odrPCS[ITM_CostTable.COMOUTSIDEPROC15_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMASSEMBLYSCRAP16_FLD] != DBNull.Value)
						objObject.ComAssemblyScrap16 = Decimal.Parse(odrPCS[ITM_CostTable.COMASSEMBLYSCRAP16_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMSHRINK17_FLD] != DBNull.Value)
						objObject.ComShrink17 = Decimal.Parse(odrPCS[ITM_CostTable.COMSHRINK17_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMFREIGHT18_FLD] != DBNull.Value)
						objObject.ComFreight18 = Decimal.Parse(odrPCS[ITM_CostTable.COMFREIGHT18_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMUSERSTANDARD1_19_FLD] != DBNull.Value)
						objObject.ComUserStandard1_19 = Decimal.Parse(odrPCS[ITM_CostTable.COMUSERSTANDARD1_19_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMUSERSTANDARD2_20_FLD] != DBNull.Value)
						objObject.ComUserStandard2_20 = Decimal.Parse(odrPCS[ITM_CostTable.COMUSERSTANDARD2_20_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMTOTALAMOUNT21_FLD] != DBNull.Value)
						objObject.ComTotalAmount21 = Decimal.Parse(odrPCS[ITM_CostTable.COMTOTALAMOUNT21_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTMATERIAL01_FLD] != DBNull.Value)
						objObject.VAddCostMaterial01 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTMATERIAL01_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTMATERIALOVERHEAD02_FLD] != DBNull.Value)
						objObject.VAddCostMaterialOverHead02 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTMATERIALOVERHEAD02_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTMACHINESETUP03_FLD] != DBNull.Value)
						objObject.VAddCostMachineSetup03 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTMACHINESETUP03_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTMACHINESETUPFIXED04_FLD] != DBNull.Value)
						objObject.VAddCostMachineSetupFixed04 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTMACHINESETUPFIXED04_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTMACHINESETUPVAR05_FLD] != DBNull.Value)
						objObject.VAddCostMachineSetupVar05 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTMACHINESETUPVAR05_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTMACHINERUN06_FLD] != DBNull.Value)
						objObject.VAddCostMachineRun06 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTMACHINERUN06_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTMACHINEFIXED07_FLD] != DBNull.Value)
						objObject.VAddCostMachineFixed07 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTMACHINEFIXED07_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTMACHINEVARIABLE08_FLD] != DBNull.Value)
						objObject.VAddCostMachineVariable08 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTMACHINEVARIABLE08_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTLABORSETUP09_FLD] != DBNull.Value)
						objObject.VAddCostLaborSetup09 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTLABORSETUP09_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTLABORSETUPFIXED10_FLD] != DBNull.Value)
						objObject.VAddCostLaborSetupFixed10 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTLABORSETUPFIXED10_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTLABORSETUPVARIABLE11_FLD] != DBNull.Value)
						objObject.VAddCostLaborSetupVariable11 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTLABORSETUPVARIABLE11_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTLABORRUN12_FLD] != DBNull.Value)
						objObject.VAddCostLaborRun12 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTLABORRUN12_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTLABORFIXED13_FLD] != DBNull.Value)
						objObject.VAddCostLaborFixed13 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTLABORFIXED13_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTLABORVARIABLE14_FLD] != DBNull.Value)
						objObject.VAddCostLaborVariable14 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTLABORVARIABLE14_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTOUTSIDEPROC15_FLD] != DBNull.Value)
						objObject.VAddCostOutsideProc15 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTOUTSIDEPROC15_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTASSEMBLYSCRAP16_FLD] != DBNull.Value)
						objObject.VAddCostAssemblyScrap16 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTASSEMBLYSCRAP16_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTSHRINK17_FLD] != DBNull.Value)
						objObject.VAddCostShrink17 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTSHRINK17_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTFREIGHT18_FLD] != DBNull.Value)
						objObject.VAddCostFreight18 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTFREIGHT18_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTUSERSTANDARD1_19_FLD] != DBNull.Value)
						objObject.VAddCostUserStandard1_19 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTUSERSTANDARD1_19_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTUSERSTANDARD2_20_FLD] != DBNull.Value)
						objObject.VAddCostUserStandard2_20 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTUSERSTANDARD2_20_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTTOTALAMOUNT21_FLD] != DBNull.Value)
						objObject.VAddCostTotalAmount21 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTTOTALAMOUNT21_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMPONENTLABORRUNHOUR_FLD] != DBNull.Value)
						objObject.ComponentLaborRunHour = Decimal.Parse(odrPCS[ITM_CostTable.COMPONENTLABORRUNHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMPONENTLABORSETUPHOUR_FLD] != DBNull.Value)
						objObject.ComponentLaborSetupHour = Decimal.Parse(odrPCS[ITM_CostTable.COMPONENTLABORSETUPHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMPONENTMACHINERUNHOUR_FLD] != DBNull.Value)
						objObject.ComponentMachineRunHour = Decimal.Parse(odrPCS[ITM_CostTable.COMPONENTMACHINERUNHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMPONENTMACHINESETUPHOUR_FLD] != DBNull.Value)
						objObject.ComponentMachineSetupHour = Decimal.Parse(odrPCS[ITM_CostTable.COMPONENTMACHINESETUPHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VALUEADDEDLABORRUNHOUR_FLD] != DBNull.Value)
						objObject.ValueAddedLaborRunHour = Decimal.Parse(odrPCS[ITM_CostTable.VALUEADDEDLABORRUNHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VALUEADDEDLABORSETUPHOUR_FLD] != DBNull.Value)
						objObject.ValueAddedLaborSetupHour = Decimal.Parse(odrPCS[ITM_CostTable.VALUEADDEDLABORSETUPHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VALUEADDEDMACHINERUNHOUR_FLD] != DBNull.Value)
						objObject.ValueAddedMachineRunHour = Decimal.Parse(odrPCS[ITM_CostTable.VALUEADDEDMACHINERUNHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VALUEADDEDMACHINESETUPHOUR_FLD] != DBNull.Value)
						objObject.ValueAddedMachineSetupHour = Decimal.Parse(odrPCS[ITM_CostTable.VALUEADDEDMACHINESETUPHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMLABORRUNHOUR_FLD] != DBNull.Value)
						objObject.ItemLaborRunHour = Decimal.Parse(odrPCS[ITM_CostTable.ITEMLABORRUNHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMLABORSETUPHOUR_FLD] != DBNull.Value)
						objObject.ItemLaborSetupHour = Decimal.Parse(odrPCS[ITM_CostTable.ITEMLABORSETUPHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMMACHINERUNHOUR_FLD] != DBNull.Value)
						objObject.ItemMachineRunHour = Decimal.Parse(odrPCS[ITM_CostTable.ITEMMACHINERUNHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMMACHINESETUPHOUR_FLD] != DBNull.Value)
						objObject.ItemMachineSetupHour = Decimal.Parse(odrPCS[ITM_CostTable.ITEMMACHINESETUPHOUR_FLD].ToString().Trim());
					objObject.BCR = odrPCS[ITM_CostTable.BCR_FLD].ToString().Trim();
					if (odrPCS[ITM_CostTable.ITEMCOSTMATERIAL01_FLD] != DBNull.Value)
						objObject.ItemCostMaterial01 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMATERIAL01_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD] != DBNull.Value)
						objObject.ItemCostMaterialOverHead02 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD] != DBNull.Value)
						objObject.ItemCostMachineSetup03 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD] != DBNull.Value)
						objObject.ItemCostMachineSetupFixed04 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD] != DBNull.Value)
						objObject.ItemCostMachineSetupVar05 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTMACHINERUN06_FLD] != DBNull.Value)
						objObject.ItemCostMachineRun06 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMACHINERUN06_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD] != DBNull.Value)
						objObject.ItemCostMachineFixed07 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD] != DBNull.Value)
						objObject.ItemCostMachineVariable08 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTLABORSETUP09_FLD] != DBNull.Value)
						objObject.ItemCostLaborSetup09 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTLABORSETUP09_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD] != DBNull.Value)
						objObject.ItemCostLaborSetupFixed10 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD] != DBNull.Value)
						objObject.ItemCostLaborSetupVariable11 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTLABORRUN12_FLD] != DBNull.Value)
						objObject.ItemCostLaborRun12 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTLABORRUN12_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTLABORFIXED13_FLD] != DBNull.Value)
						objObject.ItemCostLaborFixed13 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTLABORFIXED13_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD] != DBNull.Value)
						objObject.ItemCostLaborVariable14 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD] != DBNull.Value)
						objObject.ItemCostOutsideProc15 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD] != DBNull.Value)
						objObject.ItemCostAssemblyScrap16 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTSHRINK17_FLD] != DBNull.Value)
						objObject.ItemCostShrink17 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTSHRINK17_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTFREIGHT18_FLD] != DBNull.Value)
						objObject.ItemCostFreight18 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTFREIGHT18_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD] != DBNull.Value)
						objObject.ItemCostUserStandard1_19 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD] != DBNull.Value)
						objObject.ItemCostUserStandard2_20 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD] != DBNull.Value)
						objObject.ItemCostTotalAmount21 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD].ToString().Trim());
					objObject.ProductID = int.Parse(odrPCS[ITM_CostTable.PRODUCTID_FLD].ToString().Trim());
					objObject.CostID = int.Parse(odrPCS[ITM_CostTable.COSTID_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.CCNID_FLD] != DBNull.Value)
						objObject.CCNID = int.Parse(odrPCS[ITM_CostTable.CCNID_FLD].ToString().Trim());
					objObject.CostDescription = odrPCS[ITM_CostTable.COSTDESCRIPTION_FLD].ToString().Trim();

				}
				return objObject;
			}
			catch (OleDbException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
			}

			catch (Exception ex)
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally
			{
				if (oconPCS != null)
				{
					if (oconPCS.State != ConnectionState.Closed)
					{
						oconPCS.Close();
					}
				}
			}
		}


		//**************************************************************************              
		///    <Description>
		///       This method uses to get data from ITM_Cost of specified Product
		///    </Description>
		///    <Inputs>
		///        int product Id
		///    </Inputs>
		///    <Outputs>
		///       ITM_CostVO
		///    </Outputs>
		///    <Returns>
		///       ITM_CostVO
		///    </Returns>
		///    <Authors>
		///       DungLa
		///    </Authors>
		///    <History>
		///       16-Mar-2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public object GetCostByProduct(int pintProductID)
		{
			const string METHOD_NAME = THIS + ".GetCostByProduct()";

			OleDbDataReader odrPCS = null;
			OleDbConnection oconPCS = null;
			OleDbCommand ocmdPCS = null;
			try
			{
				string strSql = String.Empty;
				strSql = "SELECT "
					+ ITM_CostTable.MANUAL_FLD + ","
					+ ITM_CostTable.SINGLEROLLUPDATE_FLD + ","
					+ ITM_CostTable.MULTIROLLUPDATE_FLD + ","
					+ ITM_CostTable.COSTSETUPDATE_FLD + ","
					+ ITM_CostTable.COMMATERIAL01_FLD + ","
					+ ITM_CostTable.COMMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostTable.COMMACHINESETUP03_FLD + ","
					+ ITM_CostTable.COMMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostTable.COMMACHINESETUPVAR05_FLD + ","
					+ ITM_CostTable.COMMACHINERUN06_FLD + ","
					+ ITM_CostTable.COMMACHINEFIXED07_FLD + ","
					+ ITM_CostTable.COMMACHINEVARIABLE08_FLD + ","
					+ ITM_CostTable.COMLABORSETUP09_FLD + ","
					+ ITM_CostTable.COMLABORSETUPFIXED10_FLD + ","
					+ ITM_CostTable.COMLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostTable.COMLABORRUN12_FLD + ","
					+ ITM_CostTable.COMLABORFIXED13_FLD + ","
					+ ITM_CostTable.COMLABORVARIABLE14_FLD + ","
					+ ITM_CostTable.COMOUTSIDEPROC15_FLD + ","
					+ ITM_CostTable.COMASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostTable.COMSHRINK17_FLD + ","
					+ ITM_CostTable.COMFREIGHT18_FLD + ","
					+ ITM_CostTable.COMUSERSTANDARD1_19_FLD + ","
					+ ITM_CostTable.COMUSERSTANDARD2_20_FLD + ","
					+ ITM_CostTable.COMTOTALAMOUNT21_FLD + ","
					+ ITM_CostTable.VADDCOSTMATERIAL01_FLD + ","
					+ ITM_CostTable.VADDCOSTMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINESETUP03_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINESETUPVAR05_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINERUN06_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINEFIXED07_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINEVARIABLE08_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORSETUP09_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORSETUPFIXED10_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORRUN12_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORFIXED13_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORVARIABLE14_FLD + ","
					+ ITM_CostTable.VADDCOSTOUTSIDEPROC15_FLD + ","
					+ ITM_CostTable.VADDCOSTASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostTable.VADDCOSTSHRINK17_FLD + ","
					+ ITM_CostTable.VADDCOSTFREIGHT18_FLD + ","
					+ ITM_CostTable.VADDCOSTUSERSTANDARD1_19_FLD + ","
					+ ITM_CostTable.VADDCOSTUSERSTANDARD2_20_FLD + ","
					+ ITM_CostTable.VADDCOSTTOTALAMOUNT21_FLD + ","
					+ ITM_CostTable.COMPONENTLABORRUNHOUR_FLD + ","
					+ ITM_CostTable.COMPONENTLABORSETUPHOUR_FLD + ","
					+ ITM_CostTable.COMPONENTMACHINERUNHOUR_FLD + ","
					+ ITM_CostTable.COMPONENTMACHINESETUPHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDLABORRUNHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDLABORSETUPHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDMACHINERUNHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDMACHINESETUPHOUR_FLD + ","
					+ ITM_CostTable.ITEMLABORRUNHOUR_FLD + ","
					+ ITM_CostTable.ITEMLABORSETUPHOUR_FLD + ","
					+ ITM_CostTable.ITEMMACHINERUNHOUR_FLD + ","
					+ ITM_CostTable.ITEMMACHINESETUPHOUR_FLD + ","
					+ ITM_CostTable.BCR_FLD + ","
					+ ITM_CostTable.ITEMCOSTMATERIAL01_FLD + ","
					+ ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINERUN06_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUP09_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORRUN12_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORFIXED13_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD + ","
					+ ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD + ","
					+ ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostTable.ITEMCOSTSHRINK17_FLD + ","
					+ ITM_CostTable.ITEMCOSTFREIGHT18_FLD + ","
					+ ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD + ","
					+ ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD + ","
					+ ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD + ","
					+ ITM_CostTable.PRODUCTID_FLD + ","
					+ ITM_CostTable.COSTID_FLD + ","
					+ ITM_CostTable.CCNID_FLD + ","
					+ ITM_CostTable.COSTDESCRIPTION_FLD
					+ " FROM " + ITM_CostTable.TABLE_NAME
					+ " WHERE " + ITM_CostTable.PRODUCTID_FLD + "=" + pintProductID;

				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);

				ocmdPCS.Connection.Open();
				odrPCS = ocmdPCS.ExecuteReader();

				ITM_CostVO objObject = new ITM_CostVO();

				while (odrPCS.Read())
				{
					if (odrPCS[ITM_CostTable.MANUAL_FLD] != DBNull.Value)
						objObject.Manual = bool.Parse(odrPCS[ITM_CostTable.MANUAL_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.SINGLEROLLUPDATE_FLD] != DBNull.Value)
						objObject.SingleRollUpDate = DateTime.Parse(odrPCS[ITM_CostTable.SINGLEROLLUPDATE_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.MULTIROLLUPDATE_FLD] != DBNull.Value)
						objObject.MultiRollUpDate = DateTime.Parse(odrPCS[ITM_CostTable.MULTIROLLUPDATE_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COSTSETUPDATE_FLD] != DBNull.Value)
						objObject.CostSetupDate = DateTime.Parse(odrPCS[ITM_CostTable.COSTSETUPDATE_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMMATERIAL01_FLD]!= DBNull.Value)
						objObject.ComMaterial01 = Decimal.Parse(odrPCS[ITM_CostTable.COMMATERIAL01_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMMATERIALOVERHEAD02_FLD] != DBNull.Value)
						objObject.ComMaterialOverHead02 = Decimal.Parse(odrPCS[ITM_CostTable.COMMATERIALOVERHEAD02_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMMACHINESETUP03_FLD] != DBNull.Value)
						objObject.ComMachineSetup03 = Decimal.Parse(odrPCS[ITM_CostTable.COMMACHINESETUP03_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMMACHINESETUPFIXED04_FLD] != DBNull.Value)
						objObject.ComMachineSetupFixed04 = Decimal.Parse(odrPCS[ITM_CostTable.COMMACHINESETUPFIXED04_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMMACHINESETUPVAR05_FLD] != DBNull.Value)
						objObject.ComMachineSetupVar05 = Decimal.Parse(odrPCS[ITM_CostTable.COMMACHINESETUPVAR05_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMMACHINERUN06_FLD] != DBNull.Value)
						objObject.ComMachineRun06 = Decimal.Parse(odrPCS[ITM_CostTable.COMMACHINERUN06_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMMACHINEFIXED07_FLD] != DBNull.Value)
						objObject.ComMachineFixed07 = Decimal.Parse(odrPCS[ITM_CostTable.COMMACHINEFIXED07_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMMACHINEVARIABLE08_FLD] != DBNull.Value)
						objObject.ComMachineVariable08 = Decimal.Parse(odrPCS[ITM_CostTable.COMMACHINEVARIABLE08_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMLABORSETUP09_FLD] != DBNull.Value)
						objObject.ComLaborSetup09 = Decimal.Parse(odrPCS[ITM_CostTable.COMLABORSETUP09_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMLABORSETUPFIXED10_FLD] != DBNull.Value)
						objObject.ComLaborSetupFixed10 = Decimal.Parse(odrPCS[ITM_CostTable.COMLABORSETUPFIXED10_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMLABORSETUPVARIABLE11_FLD] != DBNull.Value)
						objObject.ComLaborSetupVariable11 = Decimal.Parse(odrPCS[ITM_CostTable.COMLABORSETUPVARIABLE11_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMLABORRUN12_FLD] != DBNull.Value)
						objObject.ComLaborRun12 = Decimal.Parse(odrPCS[ITM_CostTable.COMLABORRUN12_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMLABORFIXED13_FLD] != DBNull.Value)
						objObject.ComLaborFixed13 = Decimal.Parse(odrPCS[ITM_CostTable.COMLABORFIXED13_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMLABORVARIABLE14_FLD] != DBNull.Value)
						objObject.ComLaborVariable14 = Decimal.Parse(odrPCS[ITM_CostTable.COMLABORVARIABLE14_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMOUTSIDEPROC15_FLD] != DBNull.Value)
						objObject.ComOutsideProc15 = Decimal.Parse(odrPCS[ITM_CostTable.COMOUTSIDEPROC15_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMASSEMBLYSCRAP16_FLD] != DBNull.Value)
						objObject.ComAssemblyScrap16 = Decimal.Parse(odrPCS[ITM_CostTable.COMASSEMBLYSCRAP16_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMSHRINK17_FLD] != DBNull.Value)
						objObject.ComShrink17 = Decimal.Parse(odrPCS[ITM_CostTable.COMSHRINK17_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMFREIGHT18_FLD] != DBNull.Value)
						objObject.ComFreight18 = Decimal.Parse(odrPCS[ITM_CostTable.COMFREIGHT18_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMUSERSTANDARD1_19_FLD] != DBNull.Value)
						objObject.ComUserStandard1_19 = Decimal.Parse(odrPCS[ITM_CostTable.COMUSERSTANDARD1_19_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMUSERSTANDARD2_20_FLD] != DBNull.Value)
						objObject.ComUserStandard2_20 = Decimal.Parse(odrPCS[ITM_CostTable.COMUSERSTANDARD2_20_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMTOTALAMOUNT21_FLD] != DBNull.Value)
						objObject.ComTotalAmount21 = Decimal.Parse(odrPCS[ITM_CostTable.COMTOTALAMOUNT21_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTMATERIAL01_FLD] != DBNull.Value)
						objObject.VAddCostMaterial01 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTMATERIAL01_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTMATERIALOVERHEAD02_FLD] != DBNull.Value)
						objObject.VAddCostMaterialOverHead02 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTMATERIALOVERHEAD02_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTMACHINESETUP03_FLD] != DBNull.Value)
						objObject.VAddCostMachineSetup03 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTMACHINESETUP03_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTMACHINESETUPFIXED04_FLD] != DBNull.Value)
						objObject.VAddCostMachineSetupFixed04 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTMACHINESETUPFIXED04_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTMACHINESETUPVAR05_FLD] != DBNull.Value)
						objObject.VAddCostMachineSetupVar05 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTMACHINESETUPVAR05_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTMACHINERUN06_FLD] != DBNull.Value)
						objObject.VAddCostMachineRun06 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTMACHINERUN06_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTMACHINEFIXED07_FLD] != DBNull.Value)
						objObject.VAddCostMachineFixed07 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTMACHINEFIXED07_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTMACHINEVARIABLE08_FLD] != DBNull.Value)
						objObject.VAddCostMachineVariable08 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTMACHINEVARIABLE08_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTLABORSETUP09_FLD] != DBNull.Value)
						objObject.VAddCostLaborSetup09 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTLABORSETUP09_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTLABORSETUPFIXED10_FLD] != DBNull.Value)
						objObject.VAddCostLaborSetupFixed10 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTLABORSETUPFIXED10_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTLABORSETUPVARIABLE11_FLD] != DBNull.Value)
						objObject.VAddCostLaborSetupVariable11 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTLABORSETUPVARIABLE11_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTLABORRUN12_FLD] != DBNull.Value)
						objObject.VAddCostLaborRun12 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTLABORRUN12_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTLABORFIXED13_FLD] != DBNull.Value)
						objObject.VAddCostLaborFixed13 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTLABORFIXED13_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTLABORVARIABLE14_FLD] != DBNull.Value)
						objObject.VAddCostLaborVariable14 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTLABORVARIABLE14_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTOUTSIDEPROC15_FLD] != DBNull.Value)
						objObject.VAddCostOutsideProc15 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTOUTSIDEPROC15_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTASSEMBLYSCRAP16_FLD] != DBNull.Value)
						objObject.VAddCostAssemblyScrap16 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTASSEMBLYSCRAP16_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTSHRINK17_FLD] != DBNull.Value)
						objObject.VAddCostShrink17 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTSHRINK17_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTFREIGHT18_FLD] != DBNull.Value)
						objObject.VAddCostFreight18 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTFREIGHT18_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTUSERSTANDARD1_19_FLD] != DBNull.Value)
						objObject.VAddCostUserStandard1_19 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTUSERSTANDARD1_19_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTUSERSTANDARD2_20_FLD] != DBNull.Value)
						objObject.VAddCostUserStandard2_20 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTUSERSTANDARD2_20_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VADDCOSTTOTALAMOUNT21_FLD] != DBNull.Value)
						objObject.VAddCostTotalAmount21 = Decimal.Parse(odrPCS[ITM_CostTable.VADDCOSTTOTALAMOUNT21_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMPONENTLABORRUNHOUR_FLD] != DBNull.Value)
						objObject.ComponentLaborRunHour = Decimal.Parse(odrPCS[ITM_CostTable.COMPONENTLABORRUNHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMPONENTLABORSETUPHOUR_FLD] != DBNull.Value)
						objObject.ComponentLaborSetupHour = Decimal.Parse(odrPCS[ITM_CostTable.COMPONENTLABORSETUPHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMPONENTMACHINERUNHOUR_FLD] != DBNull.Value)
						objObject.ComponentMachineRunHour = Decimal.Parse(odrPCS[ITM_CostTable.COMPONENTMACHINERUNHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.COMPONENTMACHINESETUPHOUR_FLD] != DBNull.Value)
						objObject.ComponentMachineSetupHour = Decimal.Parse(odrPCS[ITM_CostTable.COMPONENTMACHINESETUPHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VALUEADDEDLABORRUNHOUR_FLD] != DBNull.Value)
						objObject.ValueAddedLaborRunHour = Decimal.Parse(odrPCS[ITM_CostTable.VALUEADDEDLABORRUNHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VALUEADDEDLABORSETUPHOUR_FLD] != DBNull.Value)
						objObject.ValueAddedLaborSetupHour = Decimal.Parse(odrPCS[ITM_CostTable.VALUEADDEDLABORSETUPHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VALUEADDEDMACHINERUNHOUR_FLD] != DBNull.Value)
						objObject.ValueAddedMachineRunHour = Decimal.Parse(odrPCS[ITM_CostTable.VALUEADDEDMACHINERUNHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.VALUEADDEDMACHINESETUPHOUR_FLD] != DBNull.Value)
						objObject.ValueAddedMachineSetupHour = Decimal.Parse(odrPCS[ITM_CostTable.VALUEADDEDMACHINESETUPHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMLABORRUNHOUR_FLD] != DBNull.Value)
						objObject.ItemLaborRunHour = Decimal.Parse(odrPCS[ITM_CostTable.ITEMLABORRUNHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMLABORSETUPHOUR_FLD] != DBNull.Value)
						objObject.ItemLaborSetupHour = Decimal.Parse(odrPCS[ITM_CostTable.ITEMLABORSETUPHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMMACHINERUNHOUR_FLD] != DBNull.Value)
						objObject.ItemMachineRunHour = Decimal.Parse(odrPCS[ITM_CostTable.ITEMMACHINERUNHOUR_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMMACHINESETUPHOUR_FLD] != DBNull.Value)
						objObject.ItemMachineSetupHour = Decimal.Parse(odrPCS[ITM_CostTable.ITEMMACHINESETUPHOUR_FLD].ToString().Trim());
					objObject.BCR = odrPCS[ITM_CostTable.BCR_FLD].ToString().Trim();
					if (odrPCS[ITM_CostTable.ITEMCOSTMATERIAL01_FLD] != DBNull.Value)
						objObject.ItemCostMaterial01 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMATERIAL01_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD] != DBNull.Value)
						objObject.ItemCostMaterialOverHead02 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD] != DBNull.Value)
						objObject.ItemCostMachineSetup03 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD] != DBNull.Value)
						objObject.ItemCostMachineSetupFixed04 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD] != DBNull.Value)
						objObject.ItemCostMachineSetupVar05 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTMACHINERUN06_FLD] != DBNull.Value)
						objObject.ItemCostMachineRun06 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMACHINERUN06_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD] != DBNull.Value)
						objObject.ItemCostMachineFixed07 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD] != DBNull.Value)
						objObject.ItemCostMachineVariable08 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTLABORSETUP09_FLD] != DBNull.Value)
						objObject.ItemCostLaborSetup09 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTLABORSETUP09_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD] != DBNull.Value)
						objObject.ItemCostLaborSetupFixed10 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD] != DBNull.Value)
						objObject.ItemCostLaborSetupVariable11 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTLABORRUN12_FLD] != DBNull.Value)
						objObject.ItemCostLaborRun12 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTLABORRUN12_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTLABORFIXED13_FLD] != DBNull.Value)
						objObject.ItemCostLaborFixed13 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTLABORFIXED13_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD] != DBNull.Value)
						objObject.ItemCostLaborVariable14 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD] != DBNull.Value)
						objObject.ItemCostOutsideProc15 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD] != DBNull.Value)
						objObject.ItemCostAssemblyScrap16 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTSHRINK17_FLD] != DBNull.Value)
						objObject.ItemCostShrink17 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTSHRINK17_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTFREIGHT18_FLD] != DBNull.Value)
						objObject.ItemCostFreight18 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTFREIGHT18_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD] != DBNull.Value)
						objObject.ItemCostUserStandard1_19 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD] != DBNull.Value)
						objObject.ItemCostUserStandard2_20 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD] != DBNull.Value)
						objObject.ItemCostTotalAmount21 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD].ToString().Trim());
					objObject.ProductID = int.Parse(odrPCS[ITM_CostTable.PRODUCTID_FLD].ToString().Trim());
					objObject.CostID = int.Parse(odrPCS[ITM_CostTable.COSTID_FLD].ToString().Trim());
					if (odrPCS[ITM_CostTable.CCNID_FLD] != DBNull.Value)
						objObject.CCNID = int.Parse(odrPCS[ITM_CostTable.CCNID_FLD].ToString().Trim());
					objObject.CostDescription = odrPCS[ITM_CostTable.COSTDESCRIPTION_FLD].ToString().Trim();

				}
				return objObject;
			}
			catch (OleDbException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
			}

			catch (Exception ex)
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally
			{
				if (oconPCS != null)
				{
					if (oconPCS.State != ConnectionState.Closed)
					{
						oconPCS.Close();
					}
				}
			}
		}


		//**************************************************************************              
		///    <Description>
		///       This method uses to update data to ITM_Cost
		///    </Description>
		///    <Inputs>
		///       ITM_CostVO       
		///    </Inputs>
		///    <Outputs>
		///       
		///    </Outputs>
		///    <Returns>
		///       
		///    </Returns>
		///    <Authors>
		///       HungLa
		///    </Authors>
		///    <History>
		///       09-Dec-2004
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public void Update(object pobjObjecVO)
		{
			const string METHOD_NAME = THIS + ".Update()";

			ITM_CostVO objObject = (ITM_CostVO) pobjObjecVO;


			//prepare value for parameters
			OleDbConnection oconPCS = null;
			OleDbCommand ocmdPCS = null;
			try
			{
				string strSql = String.Empty;
				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);
				strSql = "UPDATE ITM_Cost SET "
					+ ITM_CostTable.SINGLEROLLUPDATE_FLD + "=   ?" + ","
					+ ITM_CostTable.MULTIROLLUPDATE_FLD + "=   ?" + ","
					+ ITM_CostTable.COSTSETUPDATE_FLD + "=   ?" + ","
					+ ITM_CostTable.COMMATERIAL01_FLD + "=   ?" + ","
					+ ITM_CostTable.COMMATERIALOVERHEAD02_FLD + "=   ?" + ","
					+ ITM_CostTable.COMMACHINESETUP03_FLD + "=   ?" + ","
					+ ITM_CostTable.COMMACHINESETUPFIXED04_FLD + "=   ?" + ","
					+ ITM_CostTable.COMMACHINESETUPVAR05_FLD + "=   ?" + ","
					+ ITM_CostTable.COMMACHINERUN06_FLD + "=   ?" + ","
					+ ITM_CostTable.COMMACHINEFIXED07_FLD + "=   ?" + ","
					+ ITM_CostTable.COMMACHINEVARIABLE08_FLD + "=   ?" + ","
					+ ITM_CostTable.COMLABORSETUP09_FLD + "=   ?" + ","
					+ ITM_CostTable.COMLABORSETUPFIXED10_FLD + "=   ?" + ","
					+ ITM_CostTable.COMLABORSETUPVARIABLE11_FLD + "=   ?" + ","
					+ ITM_CostTable.COMLABORRUN12_FLD + "=   ?" + ","
					+ ITM_CostTable.COMLABORFIXED13_FLD + "=   ?" + ","
					+ ITM_CostTable.COMLABORVARIABLE14_FLD + "=   ?" + ","
					+ ITM_CostTable.COMOUTSIDEPROC15_FLD + "=   ?" + ","
					+ ITM_CostTable.COMASSEMBLYSCRAP16_FLD + "=   ?" + ","
					+ ITM_CostTable.COMSHRINK17_FLD + "=   ?" + ","
					+ ITM_CostTable.COMFREIGHT18_FLD + "=   ?" + ","
					+ ITM_CostTable.COMUSERSTANDARD1_19_FLD + "=   ?" + ","
					+ ITM_CostTable.COMUSERSTANDARD2_20_FLD + "=   ?" + ","
					+ ITM_CostTable.COMTOTALAMOUNT21_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTMATERIAL01_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTMATERIALOVERHEAD02_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTMACHINESETUP03_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTMACHINESETUPFIXED04_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTMACHINESETUPVAR05_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTMACHINERUN06_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTMACHINEFIXED07_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTMACHINEVARIABLE08_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTLABORSETUP09_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTLABORSETUPFIXED10_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTLABORSETUPVARIABLE11_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTLABORRUN12_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTLABORFIXED13_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTLABORVARIABLE14_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTOUTSIDEPROC15_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTASSEMBLYSCRAP16_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTSHRINK17_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTFREIGHT18_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTUSERSTANDARD1_19_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTUSERSTANDARD2_20_FLD + "=   ?" + ","
					+ ITM_CostTable.VADDCOSTTOTALAMOUNT21_FLD + "=   ?" + ","
					+ ITM_CostTable.COMPONENTLABORRUNHOUR_FLD + "=   ?" + ","
					+ ITM_CostTable.COMPONENTLABORSETUPHOUR_FLD + "=   ?" + ","
					+ ITM_CostTable.COMPONENTMACHINERUNHOUR_FLD + "=   ?" + ","
					+ ITM_CostTable.COMPONENTMACHINESETUPHOUR_FLD + "=   ?" + ","
					+ ITM_CostTable.VALUEADDEDLABORRUNHOUR_FLD + "=   ?" + ","
					+ ITM_CostTable.VALUEADDEDLABORSETUPHOUR_FLD + "=   ?" + ","
					+ ITM_CostTable.VALUEADDEDMACHINERUNHOUR_FLD + "=   ?" + ","
					+ ITM_CostTable.VALUEADDEDMACHINESETUPHOUR_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMLABORRUNHOUR_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMLABORSETUPHOUR_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMMACHINERUNHOUR_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMMACHINESETUPHOUR_FLD + "=   ?" + ","
					+ ITM_CostTable.BCR_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMATERIAL01_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMACHINERUN06_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUP09_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTLABORRUN12_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTLABORFIXED13_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTSHRINK17_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTFREIGHT18_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD + "=   ?" + ","
					+ ITM_CostTable.PRODUCTID_FLD + "=   ?" + ","
					+ ITM_CostTable.COSTID_FLD + "=   ?" + ","
					+ ITM_CostTable.CCNID_FLD + "=   ?" + ","
					+ ITM_CostTable.COSTDESCRIPTION_FLD + "=  ?"
					+ " WHERE " + ITM_CostTable.MANUAL_FLD + "= ?";

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.SINGLEROLLUPDATE_FLD, OleDbType.Date));
				ocmdPCS.Parameters[ITM_CostTable.SINGLEROLLUPDATE_FLD].Value = objObject.SingleRollUpDate;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.MULTIROLLUPDATE_FLD, OleDbType.Date));
				ocmdPCS.Parameters[ITM_CostTable.MULTIROLLUPDATE_FLD].Value = objObject.MultiRollUpDate;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COSTSETUPDATE_FLD, OleDbType.Date));
				ocmdPCS.Parameters[ITM_CostTable.COSTSETUPDATE_FLD].Value = objObject.CostSetupDate;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMMATERIAL01_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMMATERIAL01_FLD].Value = objObject.ComMaterial01;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMMATERIALOVERHEAD02_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMMATERIALOVERHEAD02_FLD].Value = objObject.ComMaterialOverHead02;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMMACHINESETUP03_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMMACHINESETUP03_FLD].Value = objObject.ComMachineSetup03;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMMACHINESETUPFIXED04_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMMACHINESETUPFIXED04_FLD].Value = objObject.ComMachineSetupFixed04;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMMACHINESETUPVAR05_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMMACHINESETUPVAR05_FLD].Value = objObject.ComMachineSetupVar05;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMMACHINERUN06_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMMACHINERUN06_FLD].Value = objObject.ComMachineRun06;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMMACHINEFIXED07_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMMACHINEFIXED07_FLD].Value = objObject.ComMachineFixed07;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMMACHINEVARIABLE08_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMMACHINEVARIABLE08_FLD].Value = objObject.ComMachineVariable08;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMLABORSETUP09_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMLABORSETUP09_FLD].Value = objObject.ComLaborSetup09;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMLABORSETUPFIXED10_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMLABORSETUPFIXED10_FLD].Value = objObject.ComLaborSetupFixed10;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMLABORSETUPVARIABLE11_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMLABORSETUPVARIABLE11_FLD].Value = objObject.ComLaborSetupVariable11;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMLABORRUN12_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMLABORRUN12_FLD].Value = objObject.ComLaborRun12;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMLABORFIXED13_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMLABORFIXED13_FLD].Value = objObject.ComLaborFixed13;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMLABORVARIABLE14_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMLABORVARIABLE14_FLD].Value = objObject.ComLaborVariable14;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMOUTSIDEPROC15_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMOUTSIDEPROC15_FLD].Value = objObject.ComOutsideProc15;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMASSEMBLYSCRAP16_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMASSEMBLYSCRAP16_FLD].Value = objObject.ComAssemblyScrap16;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMSHRINK17_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMSHRINK17_FLD].Value = objObject.ComShrink17;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMFREIGHT18_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMFREIGHT18_FLD].Value = objObject.ComFreight18;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMUSERSTANDARD1_19_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMUSERSTANDARD1_19_FLD].Value = objObject.ComUserStandard1_19;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMUSERSTANDARD2_20_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMUSERSTANDARD2_20_FLD].Value = objObject.ComUserStandard2_20;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMTOTALAMOUNT21_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMTOTALAMOUNT21_FLD].Value = objObject.ComTotalAmount21;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTMATERIAL01_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTMATERIAL01_FLD].Value = objObject.VAddCostMaterial01;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTMATERIALOVERHEAD02_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTMATERIALOVERHEAD02_FLD].Value = objObject.VAddCostMaterialOverHead02;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTMACHINESETUP03_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTMACHINESETUP03_FLD].Value = objObject.VAddCostMachineSetup03;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTMACHINESETUPFIXED04_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTMACHINESETUPFIXED04_FLD].Value = objObject.VAddCostMachineSetupFixed04;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTMACHINESETUPVAR05_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTMACHINESETUPVAR05_FLD].Value = objObject.VAddCostMachineSetupVar05;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTMACHINERUN06_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTMACHINERUN06_FLD].Value = objObject.VAddCostMachineRun06;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTMACHINEFIXED07_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTMACHINEFIXED07_FLD].Value = objObject.VAddCostMachineFixed07;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTMACHINEVARIABLE08_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTMACHINEVARIABLE08_FLD].Value = objObject.VAddCostMachineVariable08;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTLABORSETUP09_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTLABORSETUP09_FLD].Value = objObject.VAddCostLaborSetup09;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTLABORSETUPFIXED10_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTLABORSETUPFIXED10_FLD].Value = objObject.VAddCostLaborSetupFixed10;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTLABORSETUPVARIABLE11_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTLABORSETUPVARIABLE11_FLD].Value = objObject.VAddCostLaborSetupVariable11;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTLABORRUN12_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTLABORRUN12_FLD].Value = objObject.VAddCostLaborRun12;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTLABORFIXED13_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTLABORFIXED13_FLD].Value = objObject.VAddCostLaborFixed13;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTLABORVARIABLE14_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTLABORVARIABLE14_FLD].Value = objObject.VAddCostLaborVariable14;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTOUTSIDEPROC15_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTOUTSIDEPROC15_FLD].Value = objObject.VAddCostOutsideProc15;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTASSEMBLYSCRAP16_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTASSEMBLYSCRAP16_FLD].Value = objObject.VAddCostAssemblyScrap16;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTSHRINK17_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTSHRINK17_FLD].Value = objObject.VAddCostShrink17;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTFREIGHT18_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTFREIGHT18_FLD].Value = objObject.VAddCostFreight18;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTUSERSTANDARD1_19_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTUSERSTANDARD1_19_FLD].Value = objObject.VAddCostUserStandard1_19;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTUSERSTANDARD2_20_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTUSERSTANDARD2_20_FLD].Value = objObject.VAddCostUserStandard2_20;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VADDCOSTTOTALAMOUNT21_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VADDCOSTTOTALAMOUNT21_FLD].Value = objObject.VAddCostTotalAmount21;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMPONENTLABORRUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMPONENTLABORRUNHOUR_FLD].Value = objObject.ComponentLaborRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMPONENTLABORSETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMPONENTLABORSETUPHOUR_FLD].Value = objObject.ComponentLaborSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMPONENTMACHINERUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMPONENTMACHINERUNHOUR_FLD].Value = objObject.ComponentMachineRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COMPONENTMACHINESETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.COMPONENTMACHINESETUPHOUR_FLD].Value = objObject.ComponentMachineSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VALUEADDEDLABORRUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VALUEADDEDLABORRUNHOUR_FLD].Value = objObject.ValueAddedLaborRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VALUEADDEDLABORSETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VALUEADDEDLABORSETUPHOUR_FLD].Value = objObject.ValueAddedLaborSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VALUEADDEDMACHINERUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VALUEADDEDMACHINERUNHOUR_FLD].Value = objObject.ValueAddedMachineRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.VALUEADDEDMACHINESETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.VALUEADDEDMACHINESETUPHOUR_FLD].Value = objObject.ValueAddedMachineSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMLABORRUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMLABORRUNHOUR_FLD].Value = objObject.ItemLaborRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMLABORSETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMLABORSETUPHOUR_FLD].Value = objObject.ItemLaborSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMMACHINERUNHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMMACHINERUNHOUR_FLD].Value = objObject.ItemMachineRunHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMMACHINESETUPHOUR_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMMACHINESETUPHOUR_FLD].Value = objObject.ItemMachineSetupHour;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.BCR_FLD, OleDbType.VarChar));
				ocmdPCS.Parameters[ITM_CostTable.BCR_FLD].Value = objObject.BCR;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMATERIAL01_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMATERIAL01_FLD].Value = objObject.ItemCostMaterial01;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD].Value = objObject.ItemCostMaterialOverHead02;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD].Value = objObject.ItemCostMachineSetup03;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD].Value = objObject.ItemCostMachineSetupFixed04;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD].Value = objObject.ItemCostMachineSetupVar05;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINERUN06_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINERUN06_FLD].Value = objObject.ItemCostMachineRun06;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD].Value = objObject.ItemCostMachineFixed07;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD].Value = objObject.ItemCostMachineVariable08;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORSETUP09_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORSETUP09_FLD].Value = objObject.ItemCostLaborSetup09;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD].Value = objObject.ItemCostLaborSetupFixed10;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD].Value = objObject.ItemCostLaborSetupVariable11;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORRUN12_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORRUN12_FLD].Value = objObject.ItemCostLaborRun12;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORFIXED13_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORFIXED13_FLD].Value = objObject.ItemCostLaborFixed13;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD].Value = objObject.ItemCostLaborVariable14;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD].Value = objObject.ItemCostOutsideProc15;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD].Value = objObject.ItemCostAssemblyScrap16;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTSHRINK17_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTSHRINK17_FLD].Value = objObject.ItemCostShrink17;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTFREIGHT18_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTFREIGHT18_FLD].Value = objObject.ItemCostFreight18;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD].Value = objObject.ItemCostUserStandard1_19;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD].Value = objObject.ItemCostUserStandard2_20;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD].Value = objObject.ItemCostTotalAmount21;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.PRODUCTID_FLD, OleDbType.Integer));
				ocmdPCS.Parameters[ITM_CostTable.PRODUCTID_FLD].Value = objObject.ProductID;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COSTID_FLD, OleDbType.Integer));
				ocmdPCS.Parameters[ITM_CostTable.COSTID_FLD].Value = objObject.CostID;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.CCNID_FLD, OleDbType.Integer));
				ocmdPCS.Parameters[ITM_CostTable.CCNID_FLD].Value = objObject.CCNID;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COSTDESCRIPTION_FLD, OleDbType.VarWChar));
				ocmdPCS.Parameters[ITM_CostTable.COSTDESCRIPTION_FLD].Value = objObject.CostDescription;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.MANUAL_FLD, OleDbType.Boolean));
				ocmdPCS.Parameters[ITM_CostTable.MANUAL_FLD].Value = objObject.Manual;


				ocmdPCS.CommandText = strSql;
				ocmdPCS.Connection.Open();
				ocmdPCS.ExecuteNonQuery();
			}
			catch (OleDbException ex)
			{
				if (ex.Errors.Count > 1)
				{
					if (ex.Errors[1].NativeError == ErrorCode.SQLDUPLICATE_KEYCODE)
					{
						throw new PCSDBException(ErrorCode.DUPLICATE_KEY, METHOD_NAME, ex);				
					}
					else
					{
						throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
					}
				}
				else
					throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
			}

			catch (InvalidOperationException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
			}
			catch (Exception ex)
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally
			{
				if (oconPCS != null)
				{
					if (oconPCS.State != ConnectionState.Closed)
					{
						oconPCS.Close();
					}
				}
			}

		}

		//**************************************************************************              
		///    <Description>
		///       This method uses to update data to ITM_Cost
		///    </Description>
		///    <Inputs>
		///       ITM_CostVO       
		///    </Inputs>
		///    <Outputs>
		///       
		///    </Outputs>
		///    <Returns>
		///       
		///    </Returns>
		///    <Authors>
		///       HungLa
		///    </Authors>
		///    <History>
		///       09-Dec-2004
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public void UpdateItemCostMaintenance(object pobjObjecVO)
		{
			const string METHOD_NAME = THIS + ".UpdateItemCostMaintenance()";

			ITM_CostVO objObject = (ITM_CostVO) pobjObjecVO;


			//prepare value for parameters
			OleDbConnection oconPCS = null;
			OleDbCommand ocmdPCS = null;
			try
			{
				string strSql = String.Empty;
				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);

				strSql = "UPDATE ITM_Cost SET "
					+ ITM_CostTable.MANUAL_FLD + "= ?" + ","
					+ ITM_CostTable.COSTDESCRIPTION_FLD + "=  ?" 
					+ " WHERE " + ITM_CostTable.PRODUCTID_FLD + "= ?"
					+ " AND " + ITM_CostTable.CCNID_FLD + "=   ?" ;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.MANUAL_FLD, OleDbType.Boolean));
				ocmdPCS.Parameters[ITM_CostTable.MANUAL_FLD].Value = objObject.Manual;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.COSTDESCRIPTION_FLD, OleDbType.VarWChar));
				ocmdPCS.Parameters[ITM_CostTable.COSTDESCRIPTION_FLD].Value = objObject.CostDescription;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.PRODUCTID_FLD, OleDbType.Integer));
				ocmdPCS.Parameters[ITM_CostTable.PRODUCTID_FLD].Value = objObject.ProductID;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.CCNID_FLD, OleDbType.Integer));
				ocmdPCS.Parameters[ITM_CostTable.CCNID_FLD].Value = objObject.CCNID;

				ocmdPCS.CommandText = strSql;
				ocmdPCS.Connection.Open();
				int intNoOfEffectedRecords = ocmdPCS.ExecuteNonQuery();
				if (intNoOfEffectedRecords <= 0)
				{
					//we have to add a new row to the ITM_COST
					AddItemCostMaintenance(pobjObjecVO);
				}
			}
			catch (OleDbException ex)
			{
				if (ex.Errors.Count > 1)
				{
					if (ex.Errors[1].NativeError == ErrorCode.SQLDUPLICATE_KEYCODE)
					{
						throw new PCSDBException(ErrorCode.DUPLICATE_KEY, METHOD_NAME, ex);				
					}
					else
					{
						throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
					}
				}
				else
					throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
			}

			catch (InvalidOperationException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
			}
			catch (Exception ex)
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally
			{
				if (oconPCS != null)
				{
					if (oconPCS.State != ConnectionState.Closed)
					{
						oconPCS.Close();
					}
				}
			}

		}


		//**************************************************************************              
		///    <Description>
		///       This method uses to update data to ITM_Cost
		///    </Description>
		///    <Inputs>
		///       ITM_CostVO       
		///    </Inputs>
		///    <Outputs>
		///       
		///    </Outputs>
		///    <Returns>
		///       
		///    </Returns>
		///    <Authors>
		///       Sonht
		///    </Authors>
		///    <History>
		///       09-Dec-2004
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public void UpdateItemCost(object pobjObjecVO)
		{
			const string METHOD_NAME = THIS + ".UpdateItemCost()";

			ITM_CostVO objObject = (ITM_CostVO) pobjObjecVO;


			//prepare value for parameters
			OleDbConnection oconPCS = null;
			OleDbCommand ocmdPCS = null;
			try
			{
				string strSql = String.Empty;
				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);
				strSql = "UPDATE ITM_Cost SET "
					+ ITM_CostTable.ITEMCOSTMATERIAL01_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMACHINERUN06_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUP09_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTLABORRUN12_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTLABORFIXED13_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTSHRINK17_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTFREIGHT18_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD + "=   ?" 
					+ " WHERE " + ITM_CostTable.COSTID_FLD + "= " + objObject.CostID.ToString();

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMATERIAL01_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMATERIAL01_FLD].Value = objObject.ItemCostMaterial01;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD].Value = objObject.ItemCostMaterialOverHead02;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD].Value = objObject.ItemCostMachineSetup03;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD].Value = objObject.ItemCostMachineSetupFixed04;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD].Value = objObject.ItemCostMachineSetupVar05;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINERUN06_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINERUN06_FLD].Value = objObject.ItemCostMachineRun06;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD].Value = objObject.ItemCostMachineFixed07;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD].Value = objObject.ItemCostMachineVariable08;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORSETUP09_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORSETUP09_FLD].Value = objObject.ItemCostLaborSetup09;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD].Value = objObject.ItemCostLaborSetupFixed10;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD].Value = objObject.ItemCostLaborSetupVariable11;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORRUN12_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORRUN12_FLD].Value = objObject.ItemCostLaborRun12;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORFIXED13_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORFIXED13_FLD].Value = objObject.ItemCostLaborFixed13;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD].Value = objObject.ItemCostLaborVariable14;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD].Value = objObject.ItemCostOutsideProc15;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD].Value = objObject.ItemCostAssemblyScrap16;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTSHRINK17_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTSHRINK17_FLD].Value = objObject.ItemCostShrink17;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTFREIGHT18_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTFREIGHT18_FLD].Value = objObject.ItemCostFreight18;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD].Value = objObject.ItemCostUserStandard1_19;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD].Value = objObject.ItemCostUserStandard2_20;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD].Value = objObject.ItemCostTotalAmount21;


				ocmdPCS.CommandText = strSql;
				ocmdPCS.Connection.Open();
				ocmdPCS.ExecuteNonQuery();
			}
			catch (OleDbException ex)
			{
				if (ex.Errors.Count > 1)
				{
					if (ex.Errors[1].NativeError == ErrorCode.SQLDUPLICATE_KEYCODE)
					{
						throw new PCSDBException(ErrorCode.DUPLICATE_KEY, METHOD_NAME, ex);				
					}
					else
					{
						throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
					}
				}
				else
					throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
			}

			catch (InvalidOperationException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
			}
			catch (Exception ex)
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally
			{
				if (oconPCS != null)
				{
					if (oconPCS.State != ConnectionState.Closed)
					{
						oconPCS.Close();
					}
				}
			}

		}

		//**************************************************************************              
		///    <Description>
		///       This method uses to get all data from ITM_Cost
		///    </Description>
		///    <Inputs>
		///               
		///    </Inputs>
		///    <Outputs>
		///       DataSet
		///    </Outputs>
		///    <Returns>
		///       DataSet
		///    </Returns>
		///    <Authors>
		///       HungLa
		///    </Authors>
		///    <History>
		///       Wednesday, March 16, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public DataTable GetCostOperation(int pintProductID,int pintCCNID)
		{
			const string METHOD_NAME = THIS + ".GetCostOperation()";
			DataSet dstPCS = new DataSet();

			OleDbConnection oconPCS = null;
			OleDbCommand ocmdPCS = null;
			try
			{
				string strSql = String.Empty;

				strSql = "SELECT "
					+ " SUM(" + ITM_CostTable.COMMATERIAL01_FLD + ") as " + ITM_CostTable.COMMATERIAL01_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMMATERIALOVERHEAD02_FLD + ") as " + ITM_CostTable.COMMATERIALOVERHEAD02_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMMACHINESETUP03_FLD + ") as " + ITM_CostTable.COMMACHINESETUP03_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMMACHINESETUPFIXED04_FLD + ") as " + ITM_CostTable.COMMACHINESETUPFIXED04_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMMACHINESETUPVAR05_FLD + ") as " + ITM_CostTable.COMMACHINESETUPVAR05_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMMACHINERUN06_FLD + ") as " + ITM_CostTable.COMMACHINERUN06_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMMACHINEFIXED07_FLD + ") as " + ITM_CostTable.COMMACHINEFIXED07_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMMACHINEVARIABLE08_FLD + ") as " + ITM_CostTable.COMMACHINEVARIABLE08_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMLABORSETUP09_FLD + ") as " + ITM_CostTable.COMLABORSETUP09_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMLABORSETUPFIXED10_FLD + ") as " + ITM_CostTable.COMLABORSETUPFIXED10_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMLABORSETUPVARIABLE11_FLD + ") as " + ITM_CostTable.COMLABORSETUPVARIABLE11_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMLABORRUN12_FLD + ") as " + ITM_CostTable.COMLABORRUN12_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMLABORFIXED13_FLD + ") as " + ITM_CostTable.COMLABORFIXED13_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMLABORVARIABLE14_FLD + ") as " + ITM_CostTable.COMLABORVARIABLE14_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMOUTSIDEPROC15_FLD + ") as " + ITM_CostTable.COMOUTSIDEPROC15_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMASSEMBLYSCRAP16_FLD + ") as " + ITM_CostTable.COMASSEMBLYSCRAP16_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMSHRINK17_FLD + ") as " + ITM_CostTable.COMSHRINK17_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMFREIGHT18_FLD + ") as " + ITM_CostTable.COMFREIGHT18_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMUSERSTANDARD1_19_FLD + ") as " + ITM_CostTable.COMUSERSTANDARD1_19_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMUSERSTANDARD2_20_FLD + ") as " + ITM_CostTable.COMUSERSTANDARD2_20_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMTOTALAMOUNT21_FLD + ") as " + ITM_CostTable.COMTOTALAMOUNT21_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTMATERIAL01_FLD + ") as " + ITM_CostTable.VADDCOSTMATERIAL01_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTMATERIALOVERHEAD02_FLD + ") as " + ITM_CostTable.VADDCOSTMATERIALOVERHEAD02_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTMACHINESETUP03_FLD + ") as " + ITM_CostTable.VADDCOSTMACHINESETUP03_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTMACHINESETUPFIXED04_FLD + ") as " + ITM_CostTable.VADDCOSTMACHINESETUPFIXED04_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTMACHINESETUPVAR05_FLD + ") as " + ITM_CostTable.VADDCOSTMACHINESETUPVAR05_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTMACHINERUN06_FLD + ") as " + ITM_CostTable.VADDCOSTMACHINERUN06_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTMACHINEFIXED07_FLD + ") as " + ITM_CostTable.VADDCOSTMACHINEFIXED07_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTMACHINEVARIABLE08_FLD + ") as " + ITM_CostTable.VADDCOSTMACHINEVARIABLE08_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTLABORSETUP09_FLD + ") as " + ITM_CostTable.VADDCOSTLABORSETUP09_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTLABORSETUPFIXED10_FLD + ") as " + ITM_CostTable.VADDCOSTLABORSETUPFIXED10_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTLABORSETUPVARIABLE11_FLD + ") as " + ITM_CostTable.VADDCOSTLABORSETUPVARIABLE11_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTLABORRUN12_FLD + ") as " + ITM_CostTable.VADDCOSTLABORRUN12_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTLABORFIXED13_FLD + ") as " + ITM_CostTable.VADDCOSTLABORFIXED13_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTLABORVARIABLE14_FLD + ") as " + ITM_CostTable.VADDCOSTLABORVARIABLE14_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTOUTSIDEPROC15_FLD + ") as " + ITM_CostTable.VADDCOSTOUTSIDEPROC15_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTASSEMBLYSCRAP16_FLD + ") as " + ITM_CostTable.VADDCOSTASSEMBLYSCRAP16_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTSHRINK17_FLD + ") as " + ITM_CostTable.VADDCOSTSHRINK17_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTFREIGHT18_FLD + ") as " + ITM_CostTable.VADDCOSTFREIGHT18_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTUSERSTANDARD1_19_FLD + ") as " + ITM_CostTable.VADDCOSTUSERSTANDARD1_19_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTUSERSTANDARD2_20_FLD + ") as " + ITM_CostTable.VADDCOSTUSERSTANDARD2_20_FLD  + ","
					+ " SUM(" + ITM_CostTable.VADDCOSTTOTALAMOUNT21_FLD + ") as " + ITM_CostTable.VADDCOSTTOTALAMOUNT21_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTMATERIAL01_FLD + ") as " + ITM_CostTable.ITEMCOSTMATERIAL01_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD + ") as " + ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD + ") as " + ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD + ") as " + ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD + ") as " + ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTMACHINERUN06_FLD + ") as " + ITM_CostTable.ITEMCOSTMACHINERUN06_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD + ") as " + ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD + ") as " + ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTLABORSETUP09_FLD + ") as " + ITM_CostTable.ITEMCOSTLABORSETUP09_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD + ") as " + ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD + ") as " + ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTLABORRUN12_FLD + ") as " + ITM_CostTable.ITEMCOSTLABORRUN12_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTLABORFIXED13_FLD + ") as " + ITM_CostTable.ITEMCOSTLABORFIXED13_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD + ") as " + ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD + ") as " + ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD + ") as " + ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTSHRINK17_FLD + ") as " + ITM_CostTable.ITEMCOSTSHRINK17_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTFREIGHT18_FLD + ") as " + ITM_CostTable.ITEMCOSTFREIGHT18_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD + ") as " + ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD + ") as " + ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD + ") as " + ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD 
					+ " FROM " + ITM_CostTable.TABLE_NAME
					+ " WHERE " + ITM_CostTable.CCNID_FLD + " = " + pintCCNID 
					+ " AND " + ITM_CostTable.PRODUCTID_FLD + "=" + pintProductID;

				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);
				ocmdPCS.Connection.Open();

				OleDbDataAdapter odadPCS = new OleDbDataAdapter(ocmdPCS);
				odadPCS.Fill(dstPCS, ITM_CostTable.TABLE_NAME);

				return dstPCS.Tables[0];
			}
			catch (OleDbException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
			}
			catch (Exception ex)
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally
			{
				if (oconPCS != null)
				{
					if (oconPCS.State != ConnectionState.Closed)
					{
						oconPCS.Close();
					}
				}
			}


		}

		//**************************************************************************              
		///    <Description>
		///       This method uses to get all data from ITM_Cost
		///    </Description>
		///    <Inputs>
		///               
		///    </Inputs>
		///    <Outputs>
		///       DataSet
		///    </Outputs>
		///    <Returns>
		///       DataSet
		///    </Returns>
		///    <Authors>
		///       HungLa
		///    </Authors>
		///    <History>
		///       Wednesday, March 16, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public DataTable GetCostItemMaintenanceDesc(int pintProductID, int pintCCNID)
		{
			const string METHOD_NAME = THIS + ".GetCostItemMaintenanceDesc()";
			DataSet dstPCS = new DataSet();


			OleDbConnection oconPCS = null;
			OleDbCommand ocmdPCS = null;
			try
			{
				string strSql = String.Empty;

				strSql = "SELECT "
					+ ITM_CostTable.MANUAL_FLD + ","
					+ ITM_CostTable.COSTDESCRIPTION_FLD
					+ " FROM " + ITM_CostTable.TABLE_NAME
					+ " WHERE " + ITM_CostTable.PRODUCTID_FLD + "=" + pintProductID 
					+ "  AND " + ITM_CostTable.CCNID_FLD + "=" + pintCCNID;
				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);
				ocmdPCS.Connection.Open();

				OleDbDataAdapter odadPCS = new OleDbDataAdapter(ocmdPCS);
				odadPCS.Fill(dstPCS, ITM_CostTable.TABLE_NAME);

				return dstPCS.Tables[0];
			}
			catch (OleDbException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
			}
			catch (Exception ex)
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally
			{
				if (oconPCS != null)
				{
					if (oconPCS.State != ConnectionState.Closed)
					{
						oconPCS.Close();
					}
				}
			}


		}



		//**************************************************************************              
		///    <Description>
		///       This method uses to get all data from ITM_Cost
		///    </Description>
		///    <Inputs>
		///               
		///    </Inputs>
		///    <Outputs>
		///       DataSet
		///    </Outputs>
		///    <Returns>
		///       DataSet
		///    </Returns>
		///    <Authors>
		///       HungLa
		///    </Authors>
		///    <History>
		///       Wednesday, March 16, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public DataSet List()
		{
			const string METHOD_NAME = THIS + ".List()";
			DataSet dstPCS = new DataSet();


			OleDbConnection oconPCS = null;
			OleDbCommand ocmdPCS = null;
			try
			{
				string strSql = String.Empty;

				strSql = "SELECT "
					+ ITM_CostTable.MANUAL_FLD + ","
					+ ITM_CostTable.SINGLEROLLUPDATE_FLD + ","
					+ ITM_CostTable.MULTIROLLUPDATE_FLD + ","
					+ ITM_CostTable.COSTSETUPDATE_FLD + ","
					+ ITM_CostTable.COMMATERIAL01_FLD + ","
					+ ITM_CostTable.COMMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostTable.COMMACHINESETUP03_FLD + ","
					+ ITM_CostTable.COMMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostTable.COMMACHINESETUPVAR05_FLD + ","
					+ ITM_CostTable.COMMACHINERUN06_FLD + ","
					+ ITM_CostTable.COMMACHINEFIXED07_FLD + ","
					+ ITM_CostTable.COMMACHINEVARIABLE08_FLD + ","
					+ ITM_CostTable.COMLABORSETUP09_FLD + ","
					+ ITM_CostTable.COMLABORSETUPFIXED10_FLD + ","
					+ ITM_CostTable.COMLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostTable.COMLABORRUN12_FLD + ","
					+ ITM_CostTable.COMLABORFIXED13_FLD + ","
					+ ITM_CostTable.COMLABORVARIABLE14_FLD + ","
					+ ITM_CostTable.COMOUTSIDEPROC15_FLD + ","
					+ ITM_CostTable.COMASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostTable.COMSHRINK17_FLD + ","
					+ ITM_CostTable.COMFREIGHT18_FLD + ","
					+ ITM_CostTable.COMUSERSTANDARD1_19_FLD + ","
					+ ITM_CostTable.COMUSERSTANDARD2_20_FLD + ","
					+ ITM_CostTable.COMTOTALAMOUNT21_FLD + ","
					+ ITM_CostTable.VADDCOSTMATERIAL01_FLD + ","
					+ ITM_CostTable.VADDCOSTMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINESETUP03_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINESETUPVAR05_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINERUN06_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINEFIXED07_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINEVARIABLE08_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORSETUP09_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORSETUPFIXED10_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORRUN12_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORFIXED13_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORVARIABLE14_FLD + ","
					+ ITM_CostTable.VADDCOSTOUTSIDEPROC15_FLD + ","
					+ ITM_CostTable.VADDCOSTASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostTable.VADDCOSTSHRINK17_FLD + ","
					+ ITM_CostTable.VADDCOSTFREIGHT18_FLD + ","
					+ ITM_CostTable.VADDCOSTUSERSTANDARD1_19_FLD + ","
					+ ITM_CostTable.VADDCOSTUSERSTANDARD2_20_FLD + ","
					+ ITM_CostTable.VADDCOSTTOTALAMOUNT21_FLD + ","
					+ ITM_CostTable.COMPONENTLABORRUNHOUR_FLD + ","
					+ ITM_CostTable.COMPONENTLABORSETUPHOUR_FLD + ","
					+ ITM_CostTable.COMPONENTMACHINERUNHOUR_FLD + ","
					+ ITM_CostTable.COMPONENTMACHINESETUPHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDLABORRUNHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDLABORSETUPHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDMACHINERUNHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDMACHINESETUPHOUR_FLD + ","
					+ ITM_CostTable.ITEMLABORRUNHOUR_FLD + ","
					+ ITM_CostTable.ITEMLABORSETUPHOUR_FLD + ","
					+ ITM_CostTable.ITEMMACHINERUNHOUR_FLD + ","
					+ ITM_CostTable.ITEMMACHINESETUPHOUR_FLD + ","
					+ ITM_CostTable.BCR_FLD + ","
					+ ITM_CostTable.ITEMCOSTMATERIAL01_FLD + ","
					+ ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINERUN06_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUP09_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORRUN12_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORFIXED13_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD + ","
					+ ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD + ","
					+ ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostTable.ITEMCOSTSHRINK17_FLD + ","
					+ ITM_CostTable.ITEMCOSTFREIGHT18_FLD + ","
					+ ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD + ","
					+ ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD + ","
					+ ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD + ","
					+ ITM_CostTable.PRODUCTID_FLD + ","
					+ ITM_CostTable.COSTID_FLD + ","
					+ ITM_CostTable.CCNID_FLD + ","
					+ ITM_CostTable.COSTDESCRIPTION_FLD
					+ " FROM " + ITM_CostTable.TABLE_NAME;
				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);
				ocmdPCS.Connection.Open();

				OleDbDataAdapter odadPCS = new OleDbDataAdapter(ocmdPCS);
				odadPCS.Fill(dstPCS, ITM_CostTable.TABLE_NAME);

				return dstPCS;
			}
			catch (OleDbException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
			}
			catch (Exception ex)
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally
			{
				if (oconPCS != null)
				{
					if (oconPCS.State != ConnectionState.Closed)
					{
						oconPCS.Close();
					}
				}
			}


		}


		//**************************************************************************              
		///    <Description>
		///       This method uses to get all data from ITM_Cost
		///    </Description>
		///    <Inputs>
		///               
		///    </Inputs>
		///    <Outputs>
		///       DataSet
		///    </Outputs>
		///    <Returns>
		///       DataSet
		///    </Returns>
		///    <Authors>
		///       HungLa
		///    </Authors>
		///    <History>
		///       Wednesday, March 16, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public DataTable GetHourCostOperation(int pintProductID,int pintCCNID)
		{
			const string METHOD_NAME = THIS + ".GetHourCostOperation()";
			DataSet dstPCS = new DataSet();

			OleDbConnection oconPCS = null;
			OleDbCommand ocmdPCS = null;
			try
			{
				string strSql = String.Empty;

				strSql = "SELECT "
					+ " SUM(" + ITM_CostTable.COMPONENTLABORRUNHOUR_FLD + ") as " + ITM_CostTable.COMPONENTLABORRUNHOUR_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMPONENTLABORSETUPHOUR_FLD + ") as " + ITM_CostTable.COMPONENTLABORSETUPHOUR_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMPONENTMACHINERUNHOUR_FLD + ") as " + ITM_CostTable.COMPONENTMACHINERUNHOUR_FLD  + ","
					+ " SUM(" + ITM_CostTable.COMPONENTMACHINESETUPHOUR_FLD + ") as " + ITM_CostTable.COMPONENTMACHINESETUPHOUR_FLD  + ","
					+ " SUM(" + ITM_CostTable.VALUEADDEDLABORRUNHOUR_FLD + ") as " + ITM_CostTable.VALUEADDEDLABORRUNHOUR_FLD  + ","
					+ " SUM(" + ITM_CostTable.VALUEADDEDLABORSETUPHOUR_FLD + ") as " + ITM_CostTable.VALUEADDEDLABORSETUPHOUR_FLD  + ","
					+ " SUM(" + ITM_CostTable.VALUEADDEDMACHINERUNHOUR_FLD + ") as " + ITM_CostTable.VALUEADDEDMACHINERUNHOUR_FLD  + ","
					+ " SUM(" + ITM_CostTable.VALUEADDEDMACHINESETUPHOUR_FLD + ") as " + ITM_CostTable.VALUEADDEDMACHINESETUPHOUR_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMLABORRUNHOUR_FLD + ") as " + ITM_CostTable.ITEMLABORRUNHOUR_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMLABORSETUPHOUR_FLD + ") as " + ITM_CostTable.ITEMLABORSETUPHOUR_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMMACHINERUNHOUR_FLD + ") as " + ITM_CostTable.ITEMMACHINERUNHOUR_FLD  + ","
					+ " SUM(" + ITM_CostTable.ITEMMACHINESETUPHOUR_FLD + ") as " + ITM_CostTable.ITEMMACHINESETUPHOUR_FLD  
					+ " FROM " + ITM_CostTable.TABLE_NAME
					+ " WHERE " + ITM_CostTable.CCNID_FLD + " = " + pintCCNID 
					+ " AND " + ITM_CostTable.PRODUCTID_FLD + "=" + pintProductID;

				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);
				ocmdPCS.Connection.Open();

				OleDbDataAdapter odadPCS = new OleDbDataAdapter(ocmdPCS);
				odadPCS.Fill(dstPCS, ITM_CostTable.TABLE_NAME);

				return dstPCS.Tables[0];
			}
			catch (OleDbException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
			}
			catch (Exception ex)
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally
			{
				if (oconPCS != null)
				{
					if (oconPCS.State != ConnectionState.Closed)
					{
						oconPCS.Close();
					}
				}
			}


		}


		//**************************************************************************              
		///    <Description>
		///       This method uses to update a DataSet
		///    </Description>
		///    <Inputs>
		///        DataSet       
		///    </Inputs>
		///    <Outputs>
		///       
		///    </Outputs>
		///    <Returns>
		///       
		///    </Returns>
		///    <Authors>
		///       HungLa
		///    </Authors>
		///    <History>
		///       Wednesday, March 16, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public void UpdateDataSet(DataSet pData)
		{
			const string METHOD_NAME = THIS + ".UpdateDataSet()";
			string strSql;
			OleDbConnection oconPCS = null;
			OleDbCommandBuilder odcbPCS;
			OleDbDataAdapter odadPCS = new OleDbDataAdapter();

			try
			{
				strSql = "SELECT "
					+ ITM_CostTable.MANUAL_FLD + ","
					+ ITM_CostTable.SINGLEROLLUPDATE_FLD + ","
					+ ITM_CostTable.MULTIROLLUPDATE_FLD + ","
					+ ITM_CostTable.COSTSETUPDATE_FLD + ","
					+ ITM_CostTable.COMMATERIAL01_FLD + ","
					+ ITM_CostTable.COMMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostTable.COMMACHINESETUP03_FLD + ","
					+ ITM_CostTable.COMMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostTable.COMMACHINESETUPVAR05_FLD + ","
					+ ITM_CostTable.COMMACHINERUN06_FLD + ","
					+ ITM_CostTable.COMMACHINEFIXED07_FLD + ","
					+ ITM_CostTable.COMMACHINEVARIABLE08_FLD + ","
					+ ITM_CostTable.COMLABORSETUP09_FLD + ","
					+ ITM_CostTable.COMLABORSETUPFIXED10_FLD + ","
					+ ITM_CostTable.COMLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostTable.COMLABORRUN12_FLD + ","
					+ ITM_CostTable.COMLABORFIXED13_FLD + ","
					+ ITM_CostTable.COMLABORVARIABLE14_FLD + ","
					+ ITM_CostTable.COMOUTSIDEPROC15_FLD + ","
					+ ITM_CostTable.COMASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostTable.COMSHRINK17_FLD + ","
					+ ITM_CostTable.COMFREIGHT18_FLD + ","
					+ ITM_CostTable.COMUSERSTANDARD1_19_FLD + ","
					+ ITM_CostTable.COMUSERSTANDARD2_20_FLD + ","
					+ ITM_CostTable.COMTOTALAMOUNT21_FLD + ","
					+ ITM_CostTable.VADDCOSTMATERIAL01_FLD + ","
					+ ITM_CostTable.VADDCOSTMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINESETUP03_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINESETUPVAR05_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINERUN06_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINEFIXED07_FLD + ","
					+ ITM_CostTable.VADDCOSTMACHINEVARIABLE08_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORSETUP09_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORSETUPFIXED10_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORRUN12_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORFIXED13_FLD + ","
					+ ITM_CostTable.VADDCOSTLABORVARIABLE14_FLD + ","
					+ ITM_CostTable.VADDCOSTOUTSIDEPROC15_FLD + ","
					+ ITM_CostTable.VADDCOSTASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostTable.VADDCOSTSHRINK17_FLD + ","
					+ ITM_CostTable.VADDCOSTFREIGHT18_FLD + ","
					+ ITM_CostTable.VADDCOSTUSERSTANDARD1_19_FLD + ","
					+ ITM_CostTable.VADDCOSTUSERSTANDARD2_20_FLD + ","
					+ ITM_CostTable.VADDCOSTTOTALAMOUNT21_FLD + ","
					+ ITM_CostTable.COMPONENTLABORRUNHOUR_FLD + ","
					+ ITM_CostTable.COMPONENTLABORSETUPHOUR_FLD + ","
					+ ITM_CostTable.COMPONENTMACHINERUNHOUR_FLD + ","
					+ ITM_CostTable.COMPONENTMACHINESETUPHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDLABORRUNHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDLABORSETUPHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDMACHINERUNHOUR_FLD + ","
					+ ITM_CostTable.VALUEADDEDMACHINESETUPHOUR_FLD + ","
					+ ITM_CostTable.ITEMLABORRUNHOUR_FLD + ","
					+ ITM_CostTable.ITEMLABORSETUPHOUR_FLD + ","
					+ ITM_CostTable.ITEMMACHINERUNHOUR_FLD + ","
					+ ITM_CostTable.ITEMMACHINESETUPHOUR_FLD + ","
					+ ITM_CostTable.BCR_FLD + ","
					+ ITM_CostTable.ITEMCOSTMATERIAL01_FLD + ","
					+ ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINERUN06_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUP09_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORRUN12_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORFIXED13_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD + ","
					+ ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD + ","
					+ ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostTable.ITEMCOSTSHRINK17_FLD + ","
					+ ITM_CostTable.ITEMCOSTFREIGHT18_FLD + ","
					+ ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD + ","
					+ ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD + ","
					+ ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD + ","
					+ ITM_CostTable.PRODUCTID_FLD + ","
					+ ITM_CostTable.COSTID_FLD + ","
					+ ITM_CostTable.CCNID_FLD + ","
					+ ITM_CostTable.COSTDESCRIPTION_FLD
					+ "  FROM " + ITM_CostTable.TABLE_NAME;

				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				odadPCS.SelectCommand = new OleDbCommand(strSql, oconPCS);
				odcbPCS = new OleDbCommandBuilder(odadPCS);
				pData.EnforceConstraints = false;
				odadPCS.Update(pData, ITM_CostTable.TABLE_NAME);

			}
			catch (OleDbException ex)
			{
				if (ex.Errors.Count > 1)
				{
					if (ex.Errors[1].NativeError == ErrorCode.SQLDUPLICATE_KEYCODE)
					{
						throw new PCSDBException(ErrorCode.DUPLICATE_KEY, METHOD_NAME, ex);				
					}
					else if (ex.Errors[1].NativeError == ErrorCode.SQLCASCADE_PREVENT_KEYCODE)
					{
						throw new PCSDBException(ErrorCode.CASCADE_DELETE_PREVENT, METHOD_NAME, ex);
					}
					else
					{
						throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
					}
				}
				else
					throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
			}

			catch (InvalidOperationException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
			}
			catch (Exception ex)
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally
			{
				if (oconPCS != null)
				{
					if (oconPCS.State != ConnectionState.Closed)
					{
						oconPCS.Close();
					}
				}
			}

		}

	
		//**************************************************************************              
		///    <Description>
		///       This method uses to delete data from ITM_Cost
		///    </Description>
		///    <Inputs>
		///        CCNID, ProductID       
		///    </Inputs>
		///    <Outputs>
		///       void
		///    </Outputs>
		///    <Returns>
		///       
		///    </Returns>
		///    <Authors>
		///       Trada
		///    </Authors>
		///    <History>
		///       22/03/2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public void Delete(int pintCCNID, int pintProductID)
		{
			const string METHOD_NAME = THIS + ".Delete()";
			string strSql = String.Empty;
			strSql = "DELETE " + ITM_CostTable.TABLE_NAME + " WHERE  " + ITM_CostTable.PRODUCTID_FLD + " = " + pintProductID.ToString() + "AND " + ITM_CostTable.CCNID_FLD + "=" + pintCCNID.ToString();
			OleDbConnection oconPCS = null;
			OleDbCommand ocmdPCS = null;
			try
			{
				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);

				ocmdPCS.Connection.Open();
				ocmdPCS.ExecuteNonQuery();
				ocmdPCS = null;

			}
			catch (OleDbException ex)
			{
				if (ex.Errors.Count > 1)
				{
					if (ex.Errors[1].NativeError == ErrorCode.SQLDUPLICATE_KEYCODE)
					{
						throw new PCSDBException(ErrorCode.DUPLICATE_KEY, METHOD_NAME, ex);
					}
					else
					{
						throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
					}
				}
				else
					throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
			}

			catch (Exception ex)
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}


			finally
			{
				if (oconPCS != null)
				{
					if (oconPCS.State != ConnectionState.Closed)
					{
						oconPCS.Close();
					}
				}
			}
		}

		//**************************************************************************              
		///    <Description>
		///       This method uses to get data from ITM_Cost
		///    </Description>
		///    <Inputs>
		///        ID       
		///    </Inputs>
		///    <Outputs>
		///       ITM_CostVO
		///    </Outputs>
		///    <Returns>
		///       ITM_CostVO
		///    </Returns>
		///    <Authors>
		///       HungLa
		///    </Authors>
		///    <History>
		///       Wednesday, March 16, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public object GetItemCostVO(int pintCCNID,int pintProductID)
		{
			const string METHOD_NAME = THIS + ".GetObjectVO()";
			DataSet dstPCS = new DataSet();

			OleDbDataReader odrPCS = null;
			OleDbConnection oconPCS = null;
			OleDbCommand ocmdPCS = null;
			try
			{
				string strSql = String.Empty;
				strSql = "SELECT "
					+ ITM_CostTable.ITEMCOSTMATERIAL01_FLD + ","
					+ ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINERUN06_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD + ","
					+ ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUP09_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORRUN12_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORFIXED13_FLD + ","
					+ ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD + ","
					+ ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD + ","
					+ ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD + ","
					+ ITM_CostTable.ITEMCOSTSHRINK17_FLD + ","
					+ ITM_CostTable.ITEMCOSTFREIGHT18_FLD + ","
					+ ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD + ","
					+ ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD + ","
					+ ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD + ","
					+ ITM_CostTable.COSTID_FLD
					+ " FROM " + ITM_CostTable.TABLE_NAME
					+ " WHERE " + ITM_CostTable.CCNID_FLD + "=" + pintCCNID.ToString()
					+ " AND " + ITM_CostTable.PRODUCTID_FLD + "=" + pintProductID.ToString();

				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);

				ocmdPCS.Connection.Open();
				odrPCS = ocmdPCS.ExecuteReader();

				ITM_CostVO objObject = new ITM_CostVO();

				while (odrPCS.Read())
				{
					if(odrPCS[ITM_CostTable.ITEMCOSTMATERIAL01_FLD] != DBNull.Value)
						objObject.ItemCostMaterial01 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMATERIAL01_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD] != DBNull.Value)
						objObject.ItemCostMaterialOverHead02 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD] != DBNull.Value)
						objObject.ItemCostMachineSetup03 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD] != DBNull.Value)
						objObject.ItemCostMachineSetupFixed04 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD] != DBNull.Value)
						objObject.ItemCostMachineSetupVar05 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTMACHINERUN06_FLD] != DBNull.Value)
						objObject.ItemCostMachineRun06 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMACHINERUN06_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD] != DBNull.Value)
						objObject.ItemCostMachineFixed07 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD] != DBNull.Value)
						objObject.ItemCostMachineVariable08 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTLABORSETUP09_FLD] != DBNull.Value)
						objObject.ItemCostLaborSetup09 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTLABORSETUP09_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD] != DBNull.Value)
						objObject.ItemCostLaborSetupFixed10 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD] != DBNull.Value)
						objObject.ItemCostLaborSetupVariable11 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTLABORRUN12_FLD] != DBNull.Value)
						objObject.ItemCostLaborRun12 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTLABORRUN12_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTLABORFIXED13_FLD] != DBNull.Value)
						objObject.ItemCostLaborFixed13 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTLABORFIXED13_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD] != DBNull.Value)
						objObject.ItemCostLaborVariable14 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD] != DBNull.Value)
						objObject.ItemCostOutsideProc15 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD] != DBNull.Value)
						objObject.ItemCostAssemblyScrap16 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTSHRINK17_FLD] != DBNull.Value)
						objObject.ItemCostShrink17 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTSHRINK17_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTFREIGHT18_FLD] != DBNull.Value)
						objObject.ItemCostFreight18 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTFREIGHT18_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD] != DBNull.Value)
						objObject.ItemCostUserStandard1_19 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD] != DBNull.Value)
						objObject.ItemCostUserStandard2_20 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD].ToString().Trim());
					if(odrPCS[ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD] != DBNull.Value)
						objObject.ItemCostTotalAmount21 = Decimal.Parse(odrPCS[ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD].ToString().Trim());
					objObject.CostID = int.Parse(odrPCS[ITM_CostTable.COSTID_FLD].ToString());
				}
				return objObject;
			}
			catch (OleDbException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
			}

			catch (Exception ex)
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally
			{
				if (oconPCS != null)
				{
					if (oconPCS.State != ConnectionState.Closed)
					{
						oconPCS.Close();
					}
				}
			}
		}
		//**************************************************************************              
		///    <Description>
		///       This method uses to update data to ITM_Cost
		///    </Description>
		///    <Inputs>
		///       ITM_CostVO       
		///    </Inputs>
		///    <Outputs>
		///       
		///    </Outputs>
		///    <Returns>
		///       
		///    </Returns>
		///    <Authors>
		///       HungLa
		///    </Authors>
		///    <History>
		///       09-Dec-2004
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public void UpdateItemCostVO(object pobjObjecVO)
		{
			const string METHOD_NAME = THIS + ".UpdateItemCostVO()";

			ITM_CostVO objObject = (ITM_CostVO) pobjObjecVO;

			//prepare value for parameters
			OleDbConnection oconPCS = null;
			OleDbCommand ocmdPCS = null;
			try
			{
				string strSql = String.Empty;
				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);
				strSql = "UPDATE ITM_Cost SET "
					+ ITM_CostTable.ITEMCOSTMATERIAL01_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMACHINERUN06_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUP09_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTLABORRUN12_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTLABORFIXED13_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTSHRINK17_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTFREIGHT18_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD + "=   ?" + ","
					+ ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD + "=   ?" + ","
					+ " WHERE " + ITM_CostTable.COSTID_FLD + "=" + objObject.CostID.ToString();


				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMATERIAL01_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMATERIAL01_FLD].Value = objObject.ItemCostMaterial01;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMATERIALOVERHEAD02_FLD].Value = objObject.ItemCostMaterialOverHead02;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINESETUP03_FLD].Value = objObject.ItemCostMachineSetup03;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINESETUPFIXED04_FLD].Value = objObject.ItemCostMachineSetupFixed04;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINESETUPVAR05_FLD].Value = objObject.ItemCostMachineSetupVar05;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINERUN06_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINERUN06_FLD].Value = objObject.ItemCostMachineRun06;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINEFIXED07_FLD].Value = objObject.ItemCostMachineFixed07;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTMACHINEVARIABLE08_FLD].Value = objObject.ItemCostMachineVariable08;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORSETUP09_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORSETUP09_FLD].Value = objObject.ItemCostLaborSetup09;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORSETUPFIXED10_FLD].Value = objObject.ItemCostLaborSetupFixed10;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORSETUPVARIABLE11_FLD].Value = objObject.ItemCostLaborSetupVariable11;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORRUN12_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORRUN12_FLD].Value = objObject.ItemCostLaborRun12;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORFIXED13_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORFIXED13_FLD].Value = objObject.ItemCostLaborFixed13;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTLABORVARIABLE14_FLD].Value = objObject.ItemCostLaborVariable14;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTOUTSIDEPROC15_FLD].Value = objObject.ItemCostOutsideProc15;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTASSEMBLYSCRAP16_FLD].Value = objObject.ItemCostAssemblyScrap16;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTSHRINK17_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTSHRINK17_FLD].Value = objObject.ItemCostShrink17;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTFREIGHT18_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTFREIGHT18_FLD].Value = objObject.ItemCostFreight18;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTUSERSTANDARD1_19_FLD].Value = objObject.ItemCostUserStandard1_19;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTUSERSTANDARD2_20_FLD].Value = objObject.ItemCostUserStandard2_20;

				ocmdPCS.Parameters.Add(new OleDbParameter(ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD, OleDbType.Decimal));
				ocmdPCS.Parameters[ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD].Value = objObject.ItemCostTotalAmount21;

				ocmdPCS.CommandText = strSql;
				ocmdPCS.Connection.Open();
				ocmdPCS.ExecuteNonQuery();
			}
			catch (OleDbException ex)
			{
				if (ex.Errors.Count > 1)
				{
					if (ex.Errors[1].NativeError == ErrorCode.SQLDUPLICATE_KEYCODE)
					{
						throw new PCSDBException(ErrorCode.DUPLICATE_KEY, METHOD_NAME, ex);				
					}
					else
					{
						throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
					}
				}
				else
					throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
			}

			catch (InvalidOperationException ex)
			{
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME, ex);
			}
			catch (Exception ex)
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally
			{
				if (oconPCS != null)
				{
					if (oconPCS.State != ConnectionState.Closed)
					{
						oconPCS.Close();
					}
				}
			}

		}
		//**************************************************************************              
		///    <Description>
		///    Get ItemCostTotalAmount21 Cost by ProductID and CCNID
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       Decimal
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Monday, May 09, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		public decimal GetItemCostTotalAmount21ByProductIDCCNID(int pintProductID, int pintCCNID)
		{
			const string METHOD_NAME = THIS + ".GetAVGCostByProductIDCCNID()";
			OleDbConnection oconPCS = null;
			OleDbCommand ocmdPCS = null;
			try 
			{
				string strSql = "SELECT "
					+ ITM_CostTable.ITEMCOSTTOTALAMOUNT21_FLD
					+ " FROM " + ITM_CostTable.TABLE_NAME
					+ " WHERE " + ITM_CostTable.CCNID_FLD + "=" + pintCCNID + " and " + ITM_CostTable.PRODUCTID_FLD + " = " + pintProductID;

				
				oconPCS = new OleDbConnection(Utils.Instance.OleDbConnectionString);
				ocmdPCS = new OleDbCommand(strSql, oconPCS);

				ocmdPCS.Connection.Open();
				object objResult = ocmdPCS.ExecuteScalar();
				if ((objResult == DBNull.Value) || (objResult == null))
				{
					return 0;
				}
				else
				{
					return decimal.Parse(objResult.ToString());
				}
			}
			catch(OleDbException ex)
			{			
				throw new PCSDBException(ErrorCode.ERROR_DB, METHOD_NAME,ex);
			}
			catch (Exception ex) 
			{
				throw new PCSDBException(ErrorCode.OTHER_ERROR, METHOD_NAME, ex);
			}

			finally 
			{
				if (oconPCS!=null) 
				{
					if (oconPCS.State != ConnectionState.Closed) 
					{
						oconPCS.Close();
					}
				}
			}
		}
	}
}